@ layout = null; Var num 1 = 0; Var num 2 = 0; Var Result = 0; If (is post) { Num 1 = request [‘T1’].As Int []; Num 2 = request [‘T2’].As Int []; Result = num 1 + num2 }
In the first example we declare variable of int type and conversion is done by using Convert . to int 32 (); method This is completely in C # syntax. Here C# syntax with Razor syntax. In IInd Method we completely used Razor syntax that is Declaring the variable using keyword, and performing conversion using as int () method.
Interested in mastering ASP.net Training? Enroll now for FREE demo on ASP.net Training.
As Int () :- convert the data to integer type . As Float () :- convert the data to Float type As Decimal () :- convert the data to Decimal type. As Date and time() :- convert the data to date time type As Bool () :- convert the data to Bool type To string () :- convert the data to String type
For indepth understanding click on
You liked the article?
Like: 0
Vote for difficulty
Current difficulty (Avg): Medium
TekSlate is the best online training provider in delivering world-class IT skills to individuals and corporates from all parts of the globe. We are proven experts in accumulating every need of an IT skills upgrade aspirant and have delivered excellent services. We aim to bring you all the essentials to learn and master new technologies in the market with our articles, blogs, and videos. Build your career success with us, enhancing most in-demand skills in the market.