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

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • yaya coco

    #1

    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="delFun ction" runat="server">

    How can I do that?



  • Rajesh Tiwari

    #2
    Re: button evet ---- server side - client side ???

    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:re turn 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!

    Comment

    Working...