开发者

DataKey names in Form view

开发者 https://www.devze.com 2023-03-13 23:52 出处:网络
How to access dataKey values <asp:FormView ID=\"FormView1\" runat=\"server\"Style=\"margin-right: 65px\"

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.

0

精彩评论

暂无评论...
验证码 换一张
取 消