Message box response
-
In the Default.aspx.vb is have following coding:
Protected Sub GridView1_RowDeleting(ByVal sender As Object, ByVal e As System.Web.UI.WebControls.GridViewDeleteEventArgs) Handles GridView1.RowDeleting
MessageBox.Show("Do You want to Delete the Row..?", "Row Deleting", MessageBoxButtons.YesNo, MessageBoxIcon.Question, MessageBoxDefaultButton.Button2, MessageBoxOptions.DefaultDesktopOnly, False)
If vbNo = MsgBoxResult.No Then
e.Cancel = True
End If
End SubBut the response of message box is not coming on client machine, it is sending the response to server machine. How to get the respose on the client machine not at server machine. Thanks & Regards Girish Sharma
-
In the Default.aspx.vb is have following coding:
Protected Sub GridView1_RowDeleting(ByVal sender As Object, ByVal e As System.Web.UI.WebControls.GridViewDeleteEventArgs) Handles GridView1.RowDeleting
MessageBox.Show("Do You want to Delete the Row..?", "Row Deleting", MessageBoxButtons.YesNo, MessageBoxIcon.Question, MessageBoxDefaultButton.Button2, MessageBoxOptions.DefaultDesktopOnly, False)
If vbNo = MsgBoxResult.No Then
e.Cancel = True
End If
End SubBut the response of message box is not coming on client machine, it is sending the response to server machine. How to get the respose on the client machine not at server machine. Thanks & Regards Girish Sharma
Girish481 wrote:
MessageBox.Show("Do You want to Delete the Row..?", "Row Deleting", MessageBoxButtons.YesNo, MessageBoxIcon.Question, MessageBoxDefaultButton.Button2, MessageBoxOptions.DefaultDesktopOnly, False)
How can you use MessageBox.Show in ASP.NET, it belong to windows App. Try using confirm of JavaScript
-
Girish481 wrote:
MessageBox.Show("Do You want to Delete the Row..?", "Row Deleting", MessageBoxButtons.YesNo, MessageBoxIcon.Question, MessageBoxDefaultButton.Button2, MessageBoxOptions.DefaultDesktopOnly, False)
How can you use MessageBox.Show in ASP.NET, it belong to windows App. Try using confirm of JavaScript
-
But it is working fine; the only thing is that it is sending response to server machine. Ok, please tell me how to code confirm of javascript in this case when a user is clicking on delete link of GridView1 control. Thanks and Regards Girish Sharma
Girish481 wrote:
But it is working fine;
You are running your application from VS IDE. Try to host on IIS, access from browser and from different system As amandeep already suggested, you have to use JavaScript Confirm Box.
cheers, Abhijit CodeProject MVP
-
Girish481 wrote:
But it is working fine;
You are running your application from VS IDE. Try to host on IIS, access from browser and from different system As amandeep already suggested, you have to use JavaScript Confirm Box.
cheers, Abhijit CodeProject MVP
Thanks Abhijit for your response. Actually before this i was running my web application on server itself; but yesterday when i run from another machine; i got that messagebox's response was not at client side; it was as server machine, so i supposed that there should be extra code for messagebox or javascript confirm box. So please tell me, where and what should i code to get confirm box when user click on delete link of GridView1 control. Regards Girish Sharma
-
Thanks Abhijit for your response. Actually before this i was running my web application on server itself; but yesterday when i run from another machine; i got that messagebox's response was not at client side; it was as server machine, so i supposed that there should be extra code for messagebox or javascript confirm box. So please tell me, where and what should i code to get confirm box when user click on delete link of GridView1 control. Regards Girish Sharma
-
Thank you Abhijit for your link. I learnt from the link and finally got the result as below from TemplateField.
<asp:TemplateField ShowHeader="False"> <ItemTemplate> <asp:LinkButton ID="LinkButton1" runat="server" CausesValidation="False" CommandName="Delete" OnClientClick="return window.confirm('Are you sure ?')" Text="Delete"></asp:LinkButton> </ItemTemplate> </asp:TemplateField>
Regards Girish Sharma