I'm in a bit of a bind.
I have a page that is to do a function on page load that requires an ID number (integer) passed by a querystring - but I get the error that says "Input string was not in a correct format".
My code to get the the value of the querystring and do the function is simple and straight forward.
int custID = Convert.ToInt32(Request.QueryString["CustomID"]); RemoveItem(custID);
I've tried the following ways as well.
//1) int custID = int.Parse(Request.QueryString["CustomID"]); //2) string custID = Request.QueryString["CustomID"]; int intCustID = Convert.ToInt32(custID); RemoveItem(intCustID); //3 int custID = 0; int.TryParse(Request.QueryString["CustomID"], out custID); RemoveItem(custID); //this one only returned the value of 0.
I'm kind of at a loss. How do I convert the "CustomID" from the querystring into an integer?
This post has been edited by mb2000inc: 11 July 2012 - 12:59 PM