HOW TO CALL SERVER-SIDE FUNCTION FROM CLIENT-SIDE IN ASP.NET?

marcel ethan

Total Post:105

Points:735
Posted by  marcel ethan
 835  View(s)
Ratings:
Rate this:

I have a web page having asp.net button control and textbox. I want a confirm message box, when someone changes the content of textbox and click on button. If user click on yes then event of button should fire other wise nothing should happen. All I want is to implement AJAX call back, but it is not working with ASP.NET button control.

  1. Sumit Kesarwani

    Post:378

    Points:2694
    Re: How to call server-side function from client-side in ASP.NET?

    Hi Marcel, 


    Just add the following code to your aspx code

    <asp:Button ID="btn1" OnClientClick="return confirm('sure?');" runat="server" Text="Button" />

    Hope this will solve your problem.

Answer

NEWSLETTER

Enter your email address here always to be updated. We promise not to spam!