I have a Response.Redirect on a buttonclick with two querystring-parameters that hold the value from two textboxes. If I leave the textboxes empty I get this URL: /Order.aspx?LastName=&FirstName=. I want to replace the NULL value with "%20" like this /Order.aspx?LastName=%20&FirstName=%20.
Please help my with the if-statements to changes this, I'm really new to this. Here is my code:
protected void btnSearchFirstLastName_Click(object sender, EventArgs e)
{
Response.Redirect("~/Order.aspx?LastName=" + SearchLastName.Text.Trim() + "&FirstName=" + SearchFirstName.Text.Trim());
}