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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 30, 20262026-05-30T15:42:49+00:00 2026-05-30T15:42:49+00:00

I am successfully able to pass variables from code behind to javascript in IE,

  • 0

I am successfully able to pass variables from code behind to javascript in IE, but not in firefox.
What I do is I have these public variables in my code behind:
public string passedVar = “”;
and it gets assigned to a value in the page load event:
passedVar = “In code behind”;

and then in the aspx page, inside a script block, I do this:
var clientVar = “<%= passedVar %>”;

and then I am able to access it in other js files of that page just fine… in IE only!

If I am using javascript; however, that variable in the .js is showing up as “undefined”

I can find alternate values like hiddenfield, but I want to know why this is not working like it should!

thank you!

  • 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-30T15:42:50+00:00Added an answer on May 30, 2026 at 3:42 pm

    If you need to process data through Javascript, do an ajax call (sync or async) to an empty .aspx page (I mean code-behind only), get the data result on success event and process the data in the callback function.
    Some code based on JQuery samples:

    $.ajax({
      type: "POST",
      url: "http://myDomain/myPage.aspx",
      data: "par1=val1&par2=val2",
      async: false,
      success: function( data ) {
           /*
            * data contains the myPage.aspx response
            * it could be a single value or a comma-separated list of values
            * initialize passedVar or whatever
            */
    });
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I am trying to create virtual desktop. I complete successfully.But i am not able
Hi I'm able to successfully integrate iphone app with facebook framework. But I need
I've following problem, which I've not been able to do successfully. Your help will
it looks like I am not able to succesfully move my WCF proxy code
I have been searching for a while and yet I am not able to
I'm able to consume a local WSDL into PHP, and pass/return basic data successfully,
I m passing an url as string from UIviewController to another uiviewcontroller..i was able
I have a service defined as follows. public String getData(@QueryParam(date) Date date) I'm trying
What are the steps needed to successfully be able to remotely debug a stored
I've created my own WCF service and I've successfully been able to talk 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.