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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 7, 20262026-06-07T06:13:43+00:00 2026-06-07T06:13:43+00:00

I have been working with MVC a little while now (2 months) and am

  • 0

I have been working with MVC a little while now (2 months) and am loving it for the most part. I have come across a few instances where I cannot share values of variables between languages. For example.

In javascript/Jquery and so on I can set cookies. But the server cant get at them.

In C# / Razor I can set Query strings, ViewBags, ViewData, Sessions ect. But because this is server side, clientside javascript cant get at them.

What I want to know is, if there is a reasonably simple way I can set a variable like a string in C# or javascript, and read it either pre or post back (doesnt matter) in the other language (ie, a c# Razor variable read by Javascript, or vice versa).

I have not had need to use Json or XML yet with AJax. But if this would help I would consider it. I am new to all this so please forgive my ignorance and thank you for your help.

  • 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-07T06:13:44+00:00Added an answer on June 7, 2026 at 6:13 am

    C# -> JS

    Put variables in hidden input fields or data-* attributes and then just Javascript or jQuery to retrieve those values.

    JS -> C#

    Either use ajax to send stuff back or you could set the values of hidden inputs and then just do a normal form POST to the server.

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

Sidebar

Related Questions

I have been working with Zend for a few months now and am at
I have been working with ASP.NET MVC for a couple of months now and
I have been working on ASP.NET MVC for a while and loving it so
I'm working on an ASP.Net MVC project and have been learning a few little
Last 8 months I have been working in ASP.NET MVC framework but now I
I have been working on a little MVC project to assist in my self-learning
I have been working in ASP.NET Web Applications (not MVC) for a while at
I've been working with MVC 1 for some time now and have decided to
I have been working with Spring for a while now to realize that not
I have been working on a MVC 3 application on my laptop, which now

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.