C# Tutorials and offshore development in India
    Tutorials   Resources   Forum   Reviews   Communities   Interview   Jobs   Projects   Training   Your Ad Here    
Silverlight Games | Mentor | Code Converter | Articles | Code Factory | Computer Jokes | Members | Peer Appraisal | IT Companies | Bookmarks | Polls | Revenue Sharing | Lobby | Gift Shop |


Prizes & Awards
My Profile



Active Members
TodayLast 7 Days more...






Resources » Code Snippets » ASP.NET WebForms »

Variable declaration in ASP.Net in the ASPX page


Posted Date: 28 Nov 2008    Resource Type: Code Snippets    Category: ASP.NET WebForms
Author: SravyaMember Level: Gold    
Rating: 1 out of 5Points: 5



This Sample Code Demonstrates
Declaring Variables in the ASPX page itself.

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

void Page_Load()
{

// create variables
string strCarType1, strCarType2, strCarType3;

// fill variables
strCarType1 = "Buick";
strCarType2 = "Cadillac";
strCarType3 = "Pontiac";

// read variables
if (strCarType1 != null)
{
lblOut.Text = strCarType1 + " " ;
lblOut.Text += strCarType2 + " " ;
lblOut.Text += strCarType3;
} //end if (strCarType1 != null)

} //end void Page_Load()

< /script >
< html >
< head >

< body >
< form runat="server" >
< asp:Label runat="server" ID="lblOut"/ >< br/ >

< /body >
< /html >



Responses


No responses found. Be the first to respond and make money from revenue sharing program.

Feedbacks      
Popular Tags   What are tags ?   Search Tags  
Sign In to add tags.
Declaring variable in aspx  .  

Post Feedback


This is a strictly moderated forum. Only approved messages will appear in the site. Please use 'Spell Check' in Google toolbar before you submit.
You must Sign In to post a response.
Next Resource: Tag Mapping
Previous Resource: demo for asp.net text boxes
Return to Discussion Resource Index
Post New Resource
Category: ASP.NET WebForms


Post resources and earn money!
 
More Resources



dotNet Slackers

About Us    Contact Us    Privacy Policy    Terms Of Use