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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 20, 20262026-05-20T04:58:00+00:00 2026-05-20T04:58:00+00:00

I do not have access to the <body> tag because it is in masterpage.

  • 0

I do not have access to the <body> tag because it is in masterpage.
I want to trigger an automatic postback when the page load as:

<script type="text/javascript">
       window.onscroll=  __doPostBack("<%= button.ClientID %>", "");
</script>

where should I put this code? I get a Not implemented JS error if I place it just before the </asp:Content> tag.

Any idea how I should do this ?

PS: I need to trigger that postback because I want to populate an updatepanel when the page loads

  • 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-20T04:58:01+00:00Added an answer on May 20, 2026 at 4:58 am

    You can have such code and place it anywhere:

    <% if (!Page.IsPostBack) { %>
    <script type="text/javascript">
    window.onload = function() {
       __doPostBack("<%= button.ClientID %>", "");
    }
    </script>
    <% } %>
    

    Assuming you’re using C# – if you have VB.NET the syntax will be bit different.

    Edit: to avoid using <% and %> you can have this in the Page_Load of your page:

    if (!Page.IsPostBack) {
       this.Page.ClientScript.RegisterClientScriptBlock(this.GetType(), "auto_postback", "window.onload = function() { __doPostBack(\"" +  button.ClientID + "\", \"\"); }; ", true);
    }
    

    Edit II: alternative way with better chance of working is to have such JS code instead:

    "window.onload = function() { var buttonID = '" +  button.ClientID + "'; alert('ID: ' + buttonID + ', clicking...'); document.getElementById(buttonID).click(); }; "
    

    This will hopefully show you the client ID of the button then auto click it. If no luck make sure the ID is correct and really exist in the document and we’ll try to find what is the problem.

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

Sidebar

Related Questions

Note - I do not have access to a database and cannot use PHP,
The client machines do not have access to the SQL Server port and opening
It looks like JavaScript does not have access to authentication cookies ('ASP.NET_SessionId', '.ASPXFORMSAUTH') in
My client is running on a Tomcat server and I do not have access
In the following code, it seems class C does not have access to A's
I have an ASP.NET server that I do not have direct access to. How
I'm working within a platform that I do not have server side access to
For security reasons (I'm a developer) I do not have command line access to
The environment is Oracle 9 & 10. I do not have DBA level access.
I have access to a joomla edition but not the source, and I need

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.