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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 11, 20262026-06-11T19:47:54+00:00 2026-06-11T19:47:54+00:00

I would like to better understand the issue of setting new parameters to a

  • 0

I would like to better understand the issue of setting new parameters to a url
and retrieve it via

var ParaValue = Request.QueryString["parameterName"];

so if I have a URL : “http://www.myWebsite.aspx?UserName=Alice”

I will retrieve it via example above

string uName = Request.QueryString["UserName"].ToString();

but what if I want to alter value e.g. make UserName = “Ralf”

  • Re Edit

when a button is pressed ,
there is a parameter “state” that holds a reference to wich button was pressed
the value of state was = “none”
now i want to set it to img_button1.

i am not even sending the actuall imgbutton id

i am hard coding it just for testing /referencing

so i could know i am in the stage of event reaquested by the procidure of the given event of
button1

when event triggerd by img_button2

i whould then want to set the state to “img_button2”
etc’

  • 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-11T19:47:55+00:00Added an answer on June 11, 2026 at 7:47 pm

    after I have made my research (I couldn’t mark any answer kindly given here on my post)
    then I tested two options I’ve encountered in this Stack Overflow Page:

    first option (given by Ahmad Mageed) I have tested to work just fine .
    and readability was easy to understand (as I am still fresh to asp.net ‘tricks’)

    then followed the answer by
    annakata which was remarkably improved approach in the way that you
    don’t actually have to redirect to achieve result – Query String IS modified

    after playing around i have desided to follow annakatas approach
    and make a helper method that was using also a redirerion option
    with modified QueryString Parameters & values.

    public void QuerStrModify(string CurrQS_ParamName, string NewQs_paramName, string NewPar_Value, bool redirectWithNewQuerySettings = false)
    {
    
        // reflect to readonly property 
        PropertyInfo isReadOnly = typeof(System.Collections.Specialized.NameValueCollection).GetProperty("IsReadOnly", BindingFlags.Instance | BindingFlags.NonPublic);
    
        // make collection editable 
        isReadOnly.SetValue(this.Request.QueryString, false, null);
    
        // remove 
        this.Request.QueryString.Remove(CurrQS_ParamName);
    
        // modify 
        this.Request.QueryString.Set(NewQs_paramName, NewPar_Value);
    
        // make collection readonly again 
        isReadOnly.SetValue(this.Request.QueryString, true, null);
        string FullUrl = Request.Url.AbsolutePath;
        if (redirectWithNewQuerySettings)
        {
            Response.Redirect(string.Join("?", FullUrl, this.Request.QueryString));
        }
    
    }
    

    i find it very helpful to someone that has Considerably less experience with asp.net developmet
    so i posted it as my version of correct answer , as i see it .
    i hope it’ll help somoeone else that seeks the same Solution.

    feel free to further improve it , as i mentiond I’m not a proven talent ..yet.

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

Sidebar

Related Questions

I would like to better understand my application and specifically its memory footprint. I
I would like to better understand the basic steps needed to a take an
I would like to write a vulnerable program, to better understand Stack Overflow (causes)
I would like to understand better the mechanics and the issues behind creating library
I would really like to better understand what is involved in creating a UDF
I would like to understand better how Gridview works, in particular auto_fit . Here
i'd like to better understand the issue of casting object to a name vs
I would like to find a better algorithm to solve the following problem: There
I would like a hint or much better a solution for this: I do
I would like to know if is better to use application/javascript or application/ecmascript and

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.