|
Response.Redirect((new StringBuilder(PageBase.UrlBase))
.Append("/searchresults.aspx?type=")
.Append(index)
.Append("&fullType=")
.Append(Server.HtmlEncode(SearchDropDownList.Items[index].Text))
.Append("&text=")
.Append(Server.UrlEncode(searchText)).ToString(), false);
在上面的代码中为何在Response.Redirect((new StringBuilder(PageBase.UrlBase))后再加.Append,而不是将.Append放在重定向括号内?我觉得应该是以下这样才正确:
Response.Redirect((new StringBuilder(PageBase.UrlBase)
.Append("/searchresults.aspx?type=")
.Append(index)
.Append("&fullType=")
.Append(Server.HtmlEncode(SearchDropDownList.Items[index].Text))
.Append("&text=")
.Append(Server.UrlEncode(searchText)).ToString(), false)); |
|