How to create this condition?

  • Thread starter Miguel Dias Moura
  • 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
 
P

parshuram

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

if request.form("form") <> string.empty then
'' redirect here
end if
 
A

Anders Norås [MCAD]

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
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top