2014年7月13日 星期日

[RESOLVED] Pop up window on gridview update click


I want to show a pop up window when i click on update button of gridview. 


Please help how can implement it?




 protected void grdfesible_RowDataBound(object sender, GridViewRowEventArgs e)

        {

            if ((e.Row.RowType == DataControlRowType.DataRow))

            {



                //assuming that the required value column is the second column in gridview

                LinkButton lnkButton = (LinkButton)e.Row.FindControl("LinkButton1");

                ((LinkButton)e.Row.FindControl("LinkButton1")).Attributes.Add("onclick", "javascript:GetRowValue('" + lnkButton.Text + "')");



            }

        }



You could use JavaScript in your ASPX page by converting the CommandButton to a Template field and adding the JavaScript to the update button:




ID="LinkButton1" runat="server" CausesValidation="True"
CommandName="Update" Text="Update" OnClientClick="javascript:return confirm('Are you sure you want Update');">
 




 
 



 



Thanks for your response but i want to show a pop up window after update just to info my client that update has been taken successfully.


how this will be implemented.


please guide




hi,




Adnan dani



Thanks for your response but i want to show a pop up window after update just to info my client that update has been taken successfully.


how this will be implemented.





you can write a method .


public static void Show(System.Web.UI.Page page, string msg)
{
page.ClientScript.RegisterStartupScript(page.GetType(), "Show", "");
}

after update the data ,  then use Show(this,"update successful") .


Hope this helps


沒有留言:

張貼留言