How to access dataKey values
<asp:FormView ID="FormView1" runat="server" Style="margin-right: 65px"
DataKeyNames="MMBProfileID"
<ItemTemplate>
<table id="FormViewTable" style="width: 100%;">
<tr>
<td>
Name:
</td>
<td>
<%# Eval("M开发者_C百科MB_Name") %>
</td>
protected void Page_Load(object sender, EventArgs e)
{
MMBProfileId = Convert.ToInt32(FormView1.DataKey["MMBProfileID"]);
FormView1.DataSource = objBLL.Execute_ViewBusinessProfile(MMBProfileId);
} This is giving me an error. Input string not in correct format at (FormView1.DataKey["MMBProfileID"]);
Any hints will be appreciated Thanks Sun
I would say FormView1.DataKey["MMBProfileID"] can't be converted to an integer.
精彩评论