473,385 Members | 1,356 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,385 software developers and data experts.

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

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?

Nov 17 '05 #1
1 1945
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

*** Sent via Developersdex http://www.developersdex.com ***
Don't just participate in USENET...get rewarded for it!
Nov 17 '05 #2

This thread has been closed and replies have been disabled. Please start a new discussion.

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.