Passing Empty string parameter in URL

37,873

Solution 1

The url would look like this:

text.aspx?race=

or

text.aspx?race=&otherParam=value&etc=otherValue

Then you would have code to handle race being empty:

if(string.IsNullOrEmpty(Request.QueryString["race"]))
// handle the empty race differently

Solution 2

You can pass an empty string in url like this

test.aspx?race=%02%03

%02 - start of text ASCII Character

%03 - end of text ASCII Character

In this page you can find other characters too.

Solution 3

Dim race As String

race = ""

Response.Redirect("page.aspx?race=" & race)

Is this what you want??

Share:
37,873
user2498657
Author by

user2498657

Updated on August 28, 2020

Comments

  • user2498657
    user2498657 over 3 years

    I want to pass an empty string parameter in a url. I don't know how to do it.

    I am passing these parameters in the url for a grid. In the database if I using Race=''. I get the respective records. I need to pass this in the url

    test.aspx?race=""