How to convert a string into an Integer in ASP.net?
Answer Posted / suresh
int.Parse parses the input (casts in a sense) to an integer
value however it will throw an exception if it cant do it if
the data provided is not numeric. you should use TryParse in
.NET 2.0 to see if it can parse it.
int a = Int.Parse("int");
Convert.ToInt32() converts the string data to a proper true
int32 value, and throws an exception if it can't convert the
value.
int a = Convert.Int32("String");
| Is This Answer Correct ? | 5 Yes | 4 No |
Post New Answer View All Answers
What is server transfer?
What are the different types of proxy patterns?
What is masterpage?
what are the events raised in asp.net page life cycle?in which stage view state can be loaded?
Is viewstate enabled by default?
How to deploy/publish webservices?How many ways?Plz explain me
How do you initiate validation on the server manually? What are two situations when you might you want to do that?
I have created a configuration setting in my web.config and have kept it at the root level. How do I prevent it from being overridden by another web.config that appears lower in the hierarchy?
How can we register exception filter from the action?
Explain server control extensibility with reference to asp.net 2.0 ?
Which platform does Microsoft .NET use for exchanging data between applications?
What do you mean by serialize?
Suppose you want an asp.net function (client side) executed on the mouseover event of a button. Where do you add an event handler?
What is viewstate parameter?
What is the basic difference between asp and asp.net?