How to create this condition?

  • Thread starter Thread starter Miguel Dias Moura
  • Start date Start date
M

Miguel Dias Moura

Hello,

I use the following VB code call a page and pass a form value in the
url:

<script runat="server">
Sub goToPage(sender As Object, e As System.EventArgs)
Response.Redirect("page.aspx?city=" & Request.Form("form"))
End Sub
</script>

I want to NOT redirect when the form value is "".
Can you tell me how to do it?

Thanks,
Miguel
 
maybe i'm misunderstanding ur problem, but here goes :

if request.form("form") <> string.empty then
'' redirect here
end if
 
Sub goToPage(sender As Object, e As System.EventArgs)
Response.Redirect("page.aspx?city=" & Request.Form("form"))
End Sub
</script>

I want to NOT redirect when the form value is "".
Can you tell me how to do it?

Dim city As String
city=Request.Form("form")
If (Not city = String.Empty) Then
Response.Redirect("page.aspx?city=" & city)
End If

Anders Norås
http://dotnetjunkies.com/weblog/anoras
 
Back
Top