hi
I have gridview in page that bind it from database...
and I use hyper link in this gridview below is code:
asp:HyperLink ID="lnkRemove2" runat="server" Text = " ویرایش" NavigateUrl='<%# "ویرایش-محصول.aspx?Id=" + Eval("Id") %>' ></asp:HyperLink>
now I want use imagebutton in gridview and use exatly above code for it that when users click on image button it go to other page according Id but I don't know how I can use:
'<%# "ویرایش-محصول.aspx?Id=" + Eval("Id")
for image button I do this:
<asp:ImageButton ID="ImgEdit" runat="server" ImageUrl="~/Image/EditClass.png" CssClass="imgeditP" CausesValidation="false" onclick="ImgEdit_Click" CommandArgument = '<%# Eval("ID")%> />
and
protected void ImgEdit_Click(object sender, ImageClickEventArgs e)
{
ImageButton ImgEdit = (ImageButton)sender;
Response.Redirect("ویرایش-اطلاعات-گالری.aspx?Id="(SqlDbType.VarChar).Value = ImgEdit.CommandArgument);
}
but it is wrong make error:
Compilation Error
Description: An error occurred during the compilation of a resource required to service this request. Please review the following specific error details and modify your source code appropriately.
Compiler Error Message: CS0149: Method name expected
can you help me?
Best Regards
Neda