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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 5, 20262026-06-05T13:23:44+00:00 2026-06-05T13:23:44+00:00

I keep getting the ‘ Object Expected ‘ error within my page script when

  • 0

I keep getting the ‘Object Expected‘ error within my page script when I click the button.
I’ve debugged using fire-bug and the id passed to the JavaScript method is the correct id and document.getElementById(a) finds the button. The error keeps occurring in the _doPostBack. Can this be caused because the button is inside a modal popup in a gridview cell, and the gridview is inside a update panel.

For complete code please see this previous question event not firing I posted and resolved.

The reason I’m still using the JavaScript is the Post-Back event in the GridView.RowCommand did not occur without this.

Is there an alternative to this?

The code:

function addAcc(a) {
        var btn = document.getElementById(a); //get the button, not necessary but safer
        alert(a); //To see the button id
        _doPostBack(btn.id, ''); //do the postback so RowCommand Fires in code behind
    };

<asp:Button ID="btnAddAcc" runat="server" Text="Add Account"
OnClientClick="javascript:addAcc(this.id)" />

Thank you for any solutions and ideas.
Regards

  • 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-06-05T13:23:45+00:00Added an answer on June 5, 2026 at 1:23 pm

    the dopostback method is with two underscores not one, like

    __doPostBack
    

    so your call is like:

    __doPostBack(btn.id, '');
    

    instead of

    _doPostBack(btn.id, '');
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I keep getting this error on asp.net page button click...how do i resolve this?
I keep getting some weird error in Processing, using the following tiny piece of
I keep getting a 500 Internal Server Error when using the following Rewrite rule
I keep getting this error when I try and run this script. It has
I keep getting this error when I try and view my register user page
I keep getting this error Object reference not set to an instance of an
i keep getting this error on the car_detail.php page on my database Warning: date()
I keep getting this error 1Resource interpreted as Script but transferred with MIME type
I keep getting the following error: 'function' object has no attribute 'objects' for Like.
Keep getting this error after inserting a subdatasheet into a query and trying to

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.