button evet ---- server side - client side ???

Y

yaya coco

I want to use button. My question is that
How can use server side and client site event at the same time.
That is:

I want to use button :
when The user click the button first of all, client side ask question "Are U
sure"
If yes then send server side function ?

Button Like this
<asp:button id="btnDelete" onclick="delFunction" runat="server">

How can I do that?
 
R

Rajesh Tiwari

run this code and you will get the answer

<%@ page Language="C#" debug=true %>
<script language="C#" runat=server>
void Page_Load()
{
bt1.Attributes["onClick"]="javascript:return confirm('are u sure')";


}
public void abc(Object o,EventArgs e)
{
l.Text="Server Side Function called";
}
</script>
<form id=frm1 runat=server>
<asp:Button id=bt1 runat=server onClick="abc" Text="Submit" />
<asp:Label id=l runat=server/>
</form>

hope it helps
Rajesh
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,755
Messages
2,569,537
Members
45,020
Latest member
GenesisGai

Latest Threads

Top