问题描述
|
如何访问dataKey值
<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(\"MMB_Name\") %>
</td>
protected void Page_Load(object sender,EventArgs e)
{
MMBProfileId = Convert.ToInt32(FormView1.DataKey[\"MMBProfileID\"]);
FormView1.DataSource = objBLL.Execute_ViewBusinessProfile(MMBProfileId);
}
这给我一个错误。
输入的字符串格式不正确(FormView1.DataKey [\“ MMBProfileID \”]);
任何提示将不胜感激
谢谢
太阳
解决方法
我会说FormView1.DataKey [\“ MMBProfileID \”]无法转换为整数。