在URL中传递空字符串参数

时间:2014-01-29 05:49:17

标签: asp.net vb.net url

我想在url中传递一个空字符串参数。我不知道怎么做。

我在网格的url中传递这些参数。在数据库中如果我使用Race =''。我得到了各自的记录。我需要在URL中传递这个

test.aspx?race=""

3 个答案:

答案 0 :(得分:4)

网址看起来像这样:

text.aspx?race=

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

然后您将拥有处理种族空的代码:

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

答案 1 :(得分:1)

Dim race As String

race = ""

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

这是你想要的吗?

答案 2 :(得分:1)

您可以像这样在网址中传递一个空字符串

test.aspx?race=%02%03

%02-文本ASCII字符开始

%03-文本ASCII字符结尾

this页面上,您也可以找到其他字符。

相关问题