Solved

Validate Query String URL

Posted on 2006-11-07
4
203 Views
Last Modified: 2010-04-07
Default.aspx expects a URL variable for member number.
For example, default.aspx?MemberNumber=3270000

How can I test for things like

default.aspx?MemberNumber=#member
default.aspx?MemberNumber=

etc..etc..
0
Comment
Question by:JRockFL
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 2
4 Comments
 
LVL 43

Accepted Solution

by:
TimCottee earned 300 total points
ID: 17889815
Hi JRockFL,

If IsNumeric(Request.QueryString("MemberNumber")) Then
    'do something

Tim Cottee
0
 
LVL 4

Assisted Solution

by:satish_nagdev
satish_nagdev earned 100 total points
ID: 17890027
hi,
first check if the parameter is passed
If Request.QueryString("MemberNumber") is nothing Then
    'some problem parameter not passed.

hope it helps,
satish
0
 
LVL 11

Expert Comment

by:ethoths
ID: 17890099
A neater way to check for multiple possibilities is...


Select Case Request.QueryString("MemberNumber") & String.Empty
    Case""

0
 
LVL 11

Assisted Solution

by:ethoths
ethoths earned 100 total points
ID: 17890129
Premature submission...


A neater way to check for multiple possibilities is...

Select Case Request.QueryString("MemberNumber") & String.Empty    
    Case""

    Case "#member"


End Select

Be careful about the option compare. If set to text it is case insensitive (this might not be important).
Concatinating an empty string stops you having to explicitly check for nothing! It jsu maske the code cleaner and simpler to read.
0

Featured Post

Revamp Your Training Process

Drastically shorten your training time with WalkMe's advanced online training solution that Guides your trainees to action.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

ASP.Net to Oracle Connectivity Recently I had to develop an ASP.NET application connecting to an Oracle database.As I am doing it first time ,I had to solve several problems. This article will help to such developers  to develop an ASP.NET client…
The article shows the basic steps of integrating an HTML theme template into an ASP.NET MVC project
This video shows how to use Hyena, from SystemTools Software, to update 100 user accounts from an external text file. View in 1080p for best video quality.
Suggested Courses

751 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question