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 a web api endpoint?
How can we create a website?
What is the asp.net mvc folder conventions? : asp.net mvc
Explain the main differences between asp and asp.net?
What are client activated objects?
Can more than one person use the same login?
What is jade template engine?
What is difference between session and cookies?
What are validator? Name the validation controls in asp.net? How do you disable them? Will the asp.net validators run in server side or client side? How do you do client-side validation in .net? How to disable validator control by client side javascript?
To redirect the user to another page which method do we use without performing a round trip to the client?
From which base class all web forms are inherited?
What is difference between session and application in asp net?
What events will occur when a page is loaded?
Explain State management in asp.net
What is odata in web api?