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 6926079
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 27, 20262026-05-27T10:52:18+00:00 2026-05-27T10:52:18+00:00

I’m having a difficult time getting around AutoPostBack with ASP.NET components, and was hoping

  • 0

I’m having a difficult time getting around AutoPostBack with ASP.NET components, and was hoping someone can help. I’ve looked through multiple queries but nothing is really helping.

I have a ‘Submit’ button on my page that when clicked should do 2 things:
1. Run a server-side C# function that updates a bunch of <asp:Labels in a div tag.
2. Run a javascript animation that moves stuff around and makes the <div tag visible.

My functions work just fine by themselves, however my issue is with autopostback. If I use an <asp:Button the postback refreshes and the javascript animation is undone along with it. If I use an <input type="button" tag I am unable to run both the C# and Javascript functions. I’ve tried the following:

  1. <input type="button" runat="server" onclick="c#function" onclientclick="javascriptFunction(); return false;"
    ** runat=”server” seems to just enable postback on that button

  2. <asp:Button
    ** C# function uses Page.ClientScript.RegisterStartupScript to invoke javascript function, but postback defeats the animation.

I’m hoping to keep the javascript animations as they make the interface very clean and intuitive, so any help in keeping it is greatly appreciated. Any suggestions?

  • 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-27T10:52:18+00:00Added an answer on May 27, 2026 at 10:52 am

    You may use ajax. You can pass values to the server page thru ajax and let the server page handles (insert a record in table / send an email to someone / whatever….) it for you and return a result to you. Till you get your result. you can show a “Processing…” Message to the user.

    Here is a plugin to have the block effect.
    http://jquery.malsup.com/block/

    The below is a small example of how to do it in ajax (with jquery)

    HTML

    <html>
     <head>
       <script src="https://ajax.googleapis.com/ajax/libs/jquery/1.6.2/jquery.min.js"></script>  
      <head>
      <body>
          <input type="button" id="btnGetProd" value="Get Products" /> 
          <div id="divProducts"></div>
    
    <script type="text/javascript">
    
    $("#btnGetProd").click(function(){
    
        $("#divProducts").html("Processing your request....</div>").fadeIn(100, function ()                         
         {
            $.ajax({
                url: "myajaxserverpage.aspx?mode=getprodcusts&category=3",
                success: function (data) {
                    $("#divProducts").html(data).fadeIn(100);
                },
                error: function (req, textStatus, error) {
                    alert("Some error occured");
    
                }
    
            })
        });
      });
    </script>
    
    
    </body>
      </html>
    

    and you should have a page called myajaxserverpage.aspx which returns the content (ex: A list of products) for the div called “divProducts”

    What the above code does is , When the user click on the button, it shows the text “Processing your request…” in the div and then make an ajax call to the aspx page.Once it receives the response, it put that to the div and then do a fadeIn effect.

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

Sidebar

Related Questions

link Im having trouble converting the html entites into html characters, (&# 8217;) i
I have a jquery bug and I've been looking for hours now, I can't
I have a string like this: La Torre Eiffel paragonata all&#8217;Everest What PHP function
I'm parsing an RSS feed that has an &#8217; in it. SimpleXML turns this
We're building an app, our first using Rails 3, and we're having to build
Does anyone know how can I replace this 2 symbol below from the string
I'm having trouble keeping the paragraph square between the quote marks. In firefox the
That's pretty much it. I'm using Nokogiri to scrape a web page what has
I have just tried to save a simple *.rtf file with some websites and
I want to count how many characters a certain string has in PHP, but

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.