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 »

demo for asp.net text boxes


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



This code shows how to make use of text box in asp.net


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

void Page_Load()
{
if (Page.IsPostBack)
{lblName.Text = "";
lblAddress.Text = "";
lblPassword.Text = "";}

if (txtName.Text !="")

lblName.Text = "You have entered the following name: " + txtName.Text;


if (txtAddress.Text !="")

lblAddress.Text = "You have entered the following address: " + txtAddress.Text;


if (txtPassword.Text !="")

lblPassword.Text = "You have entered the following password: " + txtPassword.Text;


}

</script>
<html>
<head>
<title>Text Box Example</title>
</head>
<body>
<asp:Label id="lblName" runat="server"></asp:Label>
<br />
<asp:Label id="lblAddress" runat="server"></asp:Label>
<br />
<asp:Label id="lblPassword" runat="server"></asp:Label>
<br />
<form runat="server">
Please enter your name:
<asp:textbox id="txtName" runat="server"></asp:textbox>
<br />
<br />
Please enter your address:
<asp:textbox id="txtAddress" runat="server" textmode="multiline" rows="5"></asp:textbox>
<br />
<br />
Please enter your password:
<asp:textbox id="txtPassword" runat="server" textmode="password"></asp:textbox>
<br />
<br />
<input type="submit" value="Submit Query" />
</form>
</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.
Use  .  Textbox  .  Asp.net  .  

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: Variable declaration in ASP.Net in the ASPX page
Previous Resource: demo for radio button list with ASP.NET
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