R
RSB
Hi Every one,
Having tuff time to make this work ..
i want to have a button and on my form say Delete button. So once i click on
it i want to confirm "Are you sure?" on the Client Side and if client select
"Cancel" then i want to ignore the action and if "OK" selected then i want
to Execute a Server side Event or Procedure.
Now what is happening here is for "Delete1" button (in my code) even if
Client Select Cancel it is still submitting the request...
and i am getting an error for the <asp:Button> control.
Please help me...
This is what i am doing..
<%@ Page Language="vb" AutoEventWireup="false" src="mypage.aspx.vb"
Inherits="mypage"%>
<SCRIPT language="javascript">
function buttonDelete()
{
if (!(window.confirm("Are You sure u want to delete?")))
{
return(false);
}
}
</SCRIPT>
<HTML>
<BODY>
<form id="Form1" name="Form1" method="post" runat="server">
<table >
<tr>
<td >
<asp:label id="lbl1" runat="server" >Name:</asp:label></td>
<td >
<asp:textbox id="txtName" runat="server" ></asp:textbox>
</td>
</tr>
<tr>
<td >
<INPUT name="cmdDelete1" type="submit" Value="Delete1"
onClick="javascript:buttonDelete()" onserverclick="buttonDeleteServer()">
<asp:button name ="cmdDelete" id="cmdDelete" runat="server"
Text="Delete" onClick="javascript:buttonDelete()"
onserverclick="buttonDeleteServer()" > </asp:button>
</td>
</tr>
</form>
</BODY>
</HTML>
Thank you in advance
RSB
Having tuff time to make this work ..
i want to have a button and on my form say Delete button. So once i click on
it i want to confirm "Are you sure?" on the Client Side and if client select
"Cancel" then i want to ignore the action and if "OK" selected then i want
to Execute a Server side Event or Procedure.
Now what is happening here is for "Delete1" button (in my code) even if
Client Select Cancel it is still submitting the request...
and i am getting an error for the <asp:Button> control.
Please help me...
This is what i am doing..
<%@ Page Language="vb" AutoEventWireup="false" src="mypage.aspx.vb"
Inherits="mypage"%>
<SCRIPT language="javascript">
function buttonDelete()
{
if (!(window.confirm("Are You sure u want to delete?")))
{
return(false);
}
}
</SCRIPT>
<HTML>
<BODY>
<form id="Form1" name="Form1" method="post" runat="server">
<table >
<tr>
<td >
<asp:label id="lbl1" runat="server" >Name:</asp:label></td>
<td >
<asp:textbox id="txtName" runat="server" ></asp:textbox>
</td>
</tr>
<tr>
<td >
<INPUT name="cmdDelete1" type="submit" Value="Delete1"
onClick="javascript:buttonDelete()" onserverclick="buttonDeleteServer()">
<asp:button name ="cmdDelete" id="cmdDelete" runat="server"
Text="Delete" onClick="javascript:buttonDelete()"
onserverclick="buttonDeleteServer()" > </asp:button>
</td>
</tr>
</form>
</BODY>
</HTML>
Thank you in advance
RSB