GridView的ButtonLink里的按钮如何绑定带参方法?
本人新手..抓耳挠腮两个昼夜....这个样子写起来是给的反应是
编译器错误消息: CS1040: 预处理器指令必须作为一行的第一个非空白字符出现
用 CommandField 这个我会...我就想知道如何在BUTTONLINK 上绑定...求前辈指点一二..
<asp:GridView ID="GridView1" runat="server" Height="208px" Width="499px">
<Columns>
<asp:TemplateField HeaderText="EID">
<ItemTemplate>
<asp:Label ID="lableeid" Text=<%# Eval("EID") %> runat="Server" Visible="false"></asp:Label>
</ItemTemplate>
</asp:TemplateField>
<asp:TemplateField HeaderText="Titlen">
<ItemTemplate>
<asp:LinkButton ID="EssayInTo" Text=<%#Eval("Titlen")%> runat="Server"></asp:LinkButton>
</ItemTemplate>
</asp:TemplateField>
<asp:TemplateField HeaderText="Delete" >
<ItemTemplate>
<asp:LinkButton ID="EssayDelete" Text="删除" OnClick="clickdelete( <%#Eval('EID') %> )" runat="Server"></asp:LinkButton>
</ItemTemplate>
</asp:TemplateField>
</Columns>
</asp:GridView>
namespace YangyBlog.Webgridveiw
{
public partial class EssayItem : System.Web.UI.Page
{
protected void Page_Load(object sender, EventArgs e)
{
if (Session["LoginId"] == null)
{
Response.Redirect("Login.aspx");
}
EssayManger em = new EssayManger();
GridView1.Columns[1].HeaderText = "日志";
GridView1.DataSource = em.ldp(Session["LoginId"].ToString());
GridView1.DataBind();
}
protected void clickdelete(string id)
{
int eid = Convert.ToInt32(id);
EssayManger em = new EssayManger();
if (em.dbe(eid))
{
Response.Redirect("EssayItem.aspx");
}
}
protected void chickredirect(object sender, CommandEventArgs e)
{
}
}
}