c# - Displaying Integer in a Label -


how can display integer in label? doing calculating total , trying display in label.

public partial class total : system.web.ui.page {     int total;     protected void page_load(object sender, eventargs e)     {         label1.text = server.htmlencode(request.cookies["confirm"]["quantity"]);         int quantity = (int)session["textbox1value"];          if (request.cookies["user"]["items"] == "tyres")         {             total = 20 * quantity;              label2.text = ???         }     } } 

or there other way display total on same page?

use

label2.text = total.tostring(); 

or

label2.text =  convert.tostring(total); 

since text takes string have convert total integer value string calling tostring() or convert.tostring(int).


Comments

Popular posts from this blog

java - Play! framework 2.0: How to display multiple image? -

gmail - Is there any documentation for read-only access to the Google Contacts API? -

php - Controller/JToolBar not working in Joomla 2.5 -