Int, String and date variables (C#) : Type Convert « Development « ASP.Net

ASP.Net
1. ADO.net Database
2. Asp Control
3. Collections
4. Components
5. Data Binding
6. Development
7. HTML Control
8. Mobile Control
9. Page
10. Request
11. Response
12. Server
13. Session Cookie
14. User Control and Master Page
15. Validation by Control
16. Validation by Function
17. XML
Java
Java Tutorial
Java Source Code / Java Documentation
Java Open Source
Jar File Download
Java Articles
Java Products
Java by API
C# / C Sharp
C# / CSharp Tutorial
JavaScript DHTML
JavaScript Tutorial
JavaScript Reference
HTML / CSS
HTML CSS Reference
C / ANSI-C
C Tutorial
C++
C++ Tutorial
PHP
Python
SQL Server / T-SQL
SQL Server / T-SQL Tutorial
Oracle PL / SQL
Oracle PL/SQL Tutorial
PostgreSQL
SQL / MySQL
MySQL Tutorial
VB.Net
VB.Net Tutorial
Flash / Flex / ActionScript
VBA / Excel / Access / Word
Microsoft Office PowerPoint 2007 Tutorial
Microsoft Office Excel 2007 Tutorial
Microsoft Office Word 2007 Tutorial
ASP.Net » Development » Type Convert 
Int, String and date variables (C#)

<%@ Page Language="C#" Debug="true" %>
<script runat="server">

    void Page_Load()
    {
       string CapitalCityOfUK;
       int NumberOfStates;
       DateTime IndependenceDay;
    
       CapitalCityOfUK = "London";
       NumberOfStates = 50;
       IndependenceDay = Convert.ToDateTime("7/4/1776");
    
       lblCapital.Text = CapitalCityOfUK;
       lblNumStates.Text = Convert.ToString(NumberOfStates);
       lblDateIndependence.Text = Convert.ToString(IndependenceDay);
    }

</script>
<html>
<head>
    <title>Creating Variables Example</title>
</head>
<body>
    The contents of CapitalCityOfUk is: <asp:Label id="lblCapital" runat="server"></asp:Label>
    <br />
    The contents of NumberOfStates is: <asp:Label id="lblNumStates" runat="server"></asp:Label>
    <br />
    The contents of IndependenceDay is: <asp:Label id="lblDateIndependence" runat="server"></asp:Label>
</body>
</html>

           
       
Related examples in the same category
1. Convert string to double (VB.net)
2. Convert int value to string (VB.net)
3. Convert selected date from asp:Calendar to long string (VB.net)
4. Convert value in asp:TextBox to int in try catch block (VB.net)
5. Convert value in asp:TextBox to date in try catch block (VB.net)
6. Convert value in asp:TextBox to bool in try catch block (VB.net)
7. Convert value from asp:TextBox to int and compare (VB.net)
8. Convert Now (current date) to string (C#)
9. Output ASCII Code (C#)
10. Convert String to int and decimal (C#)
11. Convert double and date to string (C#)
12. Read string from asp textbox and format it to DateTime (C#)
13. Convert int to String (C#)
14. Convert date to string (C#)
w_w__w_._ja___v___a___2___s._c__o__m | Contact Us
Copyright 2003 - 08 Demo Source and Support. All rights reserved.
All other trademarks are property of their respective owners.