c# - UpdateButton_Click in form view -


i have page(manage-darkhast-maghale.aspx) include gridview , sqldatasourse.one of gridview columns hyperlink on click redirects users (pasokhmaghale.aspx?darkhastmaghaleid={0}) in second page there formview , sqldatasourse. after double click on update button on edit template on code behind have typed below codes redirect user first page.

protected void updatebutton_click(object sender, eventargs e)     {         response.redirect("manage-darkhast-maghale.aspx");     } 

but, after running site , clicking on update button page begin redirect , data has no change on gridview , database. can me please?

without seeing code hard say. information have provided need leave commandname attribute on update button in edititemtemplate i.e.

<asp:linkbutton id="updatebutton" runat="server" causesvalidation="true" commandname="update" text="update" /> 

i add following event formview execute when record has been updated:

<asp:formview id="formview1" runat="server" onitemupdated="formview1_itemupdated"... 

in code behind formview should have following:

protected void formview1_itemupdated(object sender, system.web.ui.webcontrols.formviewupdatedeventargs e) {     if (e.exception == null && e.affectedrows > 0)     {         response.redirect("manage-darkhast-maghale.aspx");     } } 

Comments

Popular posts from this blog

android - Get AccessToken using signpost OAuth without opening a browser (Two legged Oauth) -

org.mockito.exceptions.misusing.InvalidUseOfMatchersException: mockito -

google shop client API returns 400 bad request error while adding an item -