Link to home
Start Free TrialLog in
Avatar of jppinto
jppintoFlag for Portugal

asked on

Convert Request.QueryString to Integer

Hello,

I've

Public IDTopico As Integer

I'm trying to assign the QueryString("id") to the IDTopico. I've tryed like this two ways and I get error messages:

IDTopico = Request.QueryString("id")     (Error:"Conversion from string "'1'" to type 'Integer' is not valid.")

or this

IDTopico = ConvertRequest.QueryString("id")    (Error:"Input string was not in a correct format.")

Can someone help me please?

thanks,

jppinto
Avatar of tetorvik
tetorvik
Flag of Finland image

try
int.Parse(Request["id"])
Avatar of jppinto

ASKER

I think that your code is not correct. Int.Parse is not valid code!
SOLUTION
Avatar of tetorvik
tetorvik
Flag of Finland image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
SOLUTION
Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
ASKER CERTIFIED SOLUTION
Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial