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

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)

bingo thankyou :)

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.