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

Discussion in 'ASP .Net' started by yaya coco, Jul 4, 2003.

  1. yaya coco

    yaya coco Guest

    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?
    yaya coco, Jul 4, 2003
    #1
    1. Advertising

  2. 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!
    Rajesh Tiwari, Jul 4, 2003
    #2
    1. Advertising

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

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. =?Utf-8?B?Qw==?=
    Replies:
    1
    Views:
    3,219
    Hermit Dave
    Jan 16, 2004
  2. =?Utf-8?B?QmluIFNvbmcsIE1DUA==?=
    Replies:
    2
    Views:
    6,468
    rick74
    May 27, 2008
  3. alan
    Replies:
    2
    Views:
    6,393
  4. COHENMARVIN
    Replies:
    2
    Views:
    864
    Jason Kester
    Oct 20, 2005
  5. Boki
    Replies:
    5
    Views:
    609
    Darryl Pierce
    Mar 26, 2005
Loading...

Share This Page