Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6094687
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 23, 20262026-05-23T12:42:31+00:00 2026-05-23T12:42:31+00:00

<asp:Button ID=RecoverButton runat=server Text=Recover OnClick=RecoverButton_OnClick UseSubmitBehavior=false /> I kind of figured out UseSubmitBehavior=false overwrites

  • 0
<asp:Button ID="RecoverButton" runat="server" Text="Recover"
    OnClick="RecoverButton_OnClick" UseSubmitBehavior="false" />

I kind of figured out UseSubmitBehavior="false" overwrites the OnClientClick function I was providing.

I went with this then:

$(document).ready(function() {
    $("[id$=RecoverButton]").live("click", RecoverButton_OnClick);
});

function RecoverButton_OnClick(s, e) {
    var input = $("[id$=MasterUsername]").val();
    var valid = $dn.s.MailValidation(input);

    if (!valid) {
        // prevent postback here
    }
}

But I don’t know how I can prevent the postback event from firing up.
I tried doing something like e.preventDefault() but it didn’t work, ideas?

Update thing is both the __doPostback and jQuery‘s click handler seem to fire up at the same time (or maybe ASP.NET’s fires first), but I placed an alert on my RecoverButton function and firebug already shows the postback happening while the alert is there, blocking execution.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-23T12:42:32+00:00Added an answer on May 23, 2026 at 12:42 pm

    Try this:

    $(document).ready(function() {
        $("[id='<%= RecoverButton.ClientID %>']").live("click", RecoverButton_OnClick);
    }
        function RecoverButton_OnClick(event) {
            var input = $("[id$=MasterUsername]").val();
            var valid = $dn.s.MailValidation(input);
            if (!valid) {
                return false; //This cancels the submit event
            }
        }
    

    Hope this helps. Cheers

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a button like <asp:Button ID=Button1 runat=server Text=Submit onclick=RedirectToLocker OnClientClick=return false; UseSubmitBehavior=false />
<asp:TextBox ID=TextBox1 runat=server></asp:TextBox> <asp:Button ID=Button1 runat=server UseSubmitBehavior=false OnClick=Button1_Click OnClientClick=this.disabled = true; this.value = 'Submitting...';
I have the following button on a .aspx page: <asp:Button runat=server ID=bntLogin OnClick=bntLogin_Click Text=Login
I have an asp.net button to update database <asp:Button ID=btnSave runat=server Text=SaveChanges OnClick=btnSave_Click CssClass=saveButton
Here is my button <asp:Button ID=myButton Text=Click Me OnClick=doSomething(10) runat=server /> Here is the
I have a server side button as <asp:Button ID=btnSummary runat=server OnClick=btnSummary_Click Text=Next /> I
I have a button with an onclick event <asp:Button ID=btn_Save runat=server Text=Save OnClick=btn_Save_Click/> I
If I have this asp.net button: <asp:Button ID=Button_Save Width=150px OnClick=Button_Save_Click runat=server Text=Save /> In
I have button <UpdatePanel> <asp:Button CssClass=btn-send runat=server OnClick=SendMessage Text=Send /> </UpdatePanel> Server side method
I want to trigger on click of a button this: <asp:Button runat=server ID=submit Text=Submit

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.