0

Hi i have a querystring value which is use to locate a record from a database. I have set up a validation which redirects the user to a URL if they input an incorrect querystring value in the address bar. My question is, how do i redirect the user if they input a text value into the querystring variable instead of an integer.

E.g.
http://www.website.com.au?num=sfdsdf


Thankyou

2
Contributors
2
Replies
3
Views
8 Years
Discussion Span
Last Post by reptar
0

Hi,
I dont know how is your code structure, but I think that you can use this:

'event of page: Load
    Protected Sub Page_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Load
        If Not Page.IsPostBack Then
'you can evualate if the value of QueryString (nombre in this example) is a number, so you can show the information otherwise you can redirect to other page
            If IsNumeric(Request.QueryString("nombre")) Then
                'retrieve the information
            Else
                Response.Redirect("default.aspx")
            End If
        End If
    End Sub

I hope this help you... (sorry... my english is not very good)

This topic has been dead for over six months. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.