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

  • Home
  • SEARCH
  • 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 7055745
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 28, 20262026-05-28T03:47:08+00:00 2026-05-28T03:47:08+00:00

I have this code in page_load method: string orgId = Session[Lineage].ToString().Split(‘;’)[depth]; hidOrg.Value = orgId;

  • 0

I have this code in page_load method:

string orgId = Session["Lineage"].ToString().Split(';')[depth];
hidOrg.Value = orgId;

This in the aspx page:

<input type="hidden" id="hidOrg" runat="server" />

and

function doRetrieveData(objVal) {

    var org = document.getElementById("hidOrg").value;
    //do stuff
    window.location.href = "summary.aspx?multiple=" + org
}

The problem is, I’m getting an object expected error when assigning var org the value of the hidden “hidOrg” field. Thanks for any help in advance.

  • 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-28T03:47:09+00:00Added an answer on May 28, 2026 at 3:47 am

    ASP.NET generates server-control’s ClientIDs according to the control’s NamingContainer.
    So you need to pass the ClientID to your javascript function. Try this:

    var org = document.getElementById('<%=hidOrg.ClientID%>').value;
    

    Inline ASP.NET tags

    Other approaches:

    1. Pass the hiddenfield’s value to the javascript function as well. You need to put the hiddenfield directly behind the DropDownList/Select and use nextSibling to get a reference to it.

      onchange="doRetrieveData(this.value,this.nextSibling.value)
      
    2. Set the Hidden-Field’s ClientIdMode to Static (if using .NET 4.0)

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

Sidebar

Related Questions

In code-behind of an ASP.NET page I have this method: public string TestFunc() {
I have this piece of code: Page.ClientScript.RegisterClientScriptInclude(this.GetType(), Guid.NewGuid().ToString(), this.ResolveUrl(~/Scripts/min.js)); When we push to our
I have this code inside the Page_Load of the Site.Master.cs . if(User.IsInRole(Read)) { NavigationMenu.Visible
I have a file named AttachmentDownload.aspx and inside Page_Load method have such code which
I have this line of code for page load: if ($(input).is(':checked')) { and it
I have this code that fetches some text from a page using BeautifulSoup soup=
I have a master page in C#, where I have this code: <div style=width:
Okay, I have this code: <script language=javascript type=text/javascript> <!-- function requestPage(page) { var request
i have tried this code to redirect a php page.but it s not working
I have used this code for extracting urls from web page.But in the line

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.