object o = Request.QueryString["eid"];So, what's the problem here?
string strEId = ((o == null) ? string.Empty : o.ToString());
int eid = Convert.ToInt32(strEId);
Well, first off, the following code does the exact same thing without all of the unnecessary conversions:
int eid = Convert.ToInt32(Request.QueryString["eid"]);...but you still have to wrap it in a
try/catchblock in case someone modifies the query string so that it passes in a non-numeric query string value.
The more cruft I strip away, the cleaner the code feels.