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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 12, 20262026-06-12T09:49:15+00:00 2026-06-12T09:49:15+00:00

I have passed a value through a url to a C# .net page using

  • 0

I have passed a value through a url to a C# .net page using query string. The url of the page looks like this:

http://contoso.com/products.aspx?field1=value1

And in C#, I have this to catch it:

String myValue = Request.QueryString["field1"];

What im looking to do is use this value in the page, something like this:

<h1><%# Eval("myValue") %></h1>

How would I go about doing this? Obviously this HTML code doesn’t work. I have exhausted some google searches on the subject so any information would be appreciated!!

  • 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-12T09:49:17+00:00Added an answer on June 12, 2026 at 9:49 am

    You can either create a Property on your page and use code tags, or set the h1 tag as runat="server" and set the value like that.

    Property:

    public string MyString{ get; set; }
    
    public void Page_Load(object sender, EventArgs e)
    {
        MyString = Request.QueryString["field1"];
    }
    

    Then in your markup:

    <h1><%= MyString %></h1>
    

    Alternatively, using the runat="server" method on the h1 tag:

    Markup:

    <h1 id="myH1" runat="server"></h1>
    

    Code:

    myH1.InnerText = Request.QueryString["field1"].ToString();
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a page with a textbox that passed a value through a stored
I have passed to template dictionary parameters like parameters={ 'value':'some_value', 'style':{} } and inside
Hey, say I have a url just being passed through my php is there
I have product ID passed thgrough a URL like so: if($_POST['purchase']) { foreach($cart->get_contents() as
I have a little web app that uses the Facebook like widget. This page
Using latest Spring-MVC (3.1.2.RELEASE) I have a pagable REST method something like: @RequestMapping(value =
alot of time in programming the value of variables are passed through url parameters,
I have a function which checks the passed value and returns false or true,
Lets say I have a function where the parameter is passed by value instead
I have a universal data type, which is passed by value, but does not

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.