c# - No overload for 'Button1_Click' matches delegate 'System.EventHandler'? -
i want display values db grid view image file. while using given below code shows error. me find proper solution.
code:
protected void button1_click(object sender, gridviewroweventargs e1) { shadinganalysisdatasettableadapters.tbl_sitelayoutuploadtableadapter sl; sl = new shadinganalysisdatasettableadapters.tbl_sitelayoutuploadtableadapter(); datatable dt = new datatable(); dt = sl.getgriddata(ddlsit.selectedvalue, int.parse(ddlversion.selectedvalue)); try { if (e1.row.rowtype == datacontrolrowtype.datarow && gvedit.editindex == e1.row.rowindex) { image image1 = (image)e1.row.findcontrol("image1"); foreach (datarow row in dt.rows) { byte[] img1 = (byte[])row["imgdata"]; string base1 = convert.tobase64string(img1); image1.imageurl = "data:image/jpg;base64," + base1; } } gvedit.datasource = dt; gvedit.databind(); } catch (nullreferenceexception ex) { } }
aspx:
<asp:button id="button1" runat="server" text="submit" onclick="button1_click" />
you need change function prototype below:
protected void button1_click(object sender, eventargs e1) { }
Comments
Post a Comment