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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 12, 20262026-06-12T00:30:03+00:00 2026-06-12T00:30:03+00:00

i have made a helper Method using it to modify Query Strings, for testing

  • 0

i have made a helper Method using it to modify Query Strings, for testing and debugging

the only problem now is that i would like to make it as a Class in my
C# collection helper-class

the method is working perfectly now , but as i am still “fresh” .net developer

i couldn’t figure out how to use
this.Request.QueryString to access current partial class – form (form1)
values when it’s inside a separated public static or non static class

this is the code , you’re free to use it (:

public void QsModify(string action, string NewP_Value, string CurQS_ParamName, string         NewQs_paramName=null, bool redirectWithNewQuerySettings=false)
{

#region <<=========== reflect to readonly & set QueriString ReadOnly - 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);

#endregion
switch (action)
{
    case ModAQs_Remove:
        if (notEmptyQs()) 
        this.Request.QueryString.Remove(CurQS_ParamName);
        break;
    case ModAQs_Replace:
        this.Request.QueryString.Remove(CurQS_ParamName);
        this.Request.QueryString.Add(NewQs_paramName, NewP_Value);
        break;
    case ModAQs_EditValue:
        this.Request.QueryString.Set(CurQS_ParamName, NewP_Value);
        break;

    case ModAQs_Add:
        this.Request.QueryString.Add(NewQs_paramName, NewP_Value);
        break;

}


#region <<=========== joining Full Path & queryString then Redirection  ============>>


string seperator = "?";
UrlPath = Request.Url.AbsolutePath;
UrlPathAndQuery = string.Join(seperator, UrlPath, this.Request.QueryString);
isReadOnly.SetValue(this.Request.QueryString, true, null);

if (redirectWithNewQuerySettings)
{

    Response.Redirect(UrlPathAndQuery);
}
#endregion
}

how do i make it into a class that will be able to access any project i am working on
not knowing what the form name will be

  • 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-12T00:30:04+00:00Added an answer on June 12, 2026 at 12:30 am

    You can use

    HttpContext.Current.Request.QueryString["qs_key"];
    

    You can use it either in static or non-static contexts.

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

Sidebar

Related Questions

I have made some helper functions that run a simulation using a lot of
I have made a String[] array by using String.split(.) . I am now trying
i have a problem with the kohana pagination. i have made a method for
I have made a small helper that adds class=selected . Primarily it uses current_page?
I have made a jQuery toggle for a menu that I had in mind.
i have made an application having entity framewrok. It is wpf application, now it
I have made a code that read data from flash Nand (without filesystem). fd
I have made a website using( Asp.net, c# ) and its content in English
here are two little helper methods I have made for downloading files. I have
DUPLICATE: Using a Django custom model method property in order_by() I have two models;

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.