Wednesday, 3 August 2016

write a program to place basic ,password and multiline textbox contain 5 rows in asp.net

row.aspx

<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="row.aspx.cs" Inherits="our_program.row" %>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
    <title>Basic passowrd and multiline</title>
    <center><h1>Basic passowrd and multiline</h1></center>
    <script runat="server">

      protected void SubmitButton_Click(Object sender, EventArgs e)
      {

         username.Text = "<br/>Username is:" + txt1.Text;
         password.Text = "<br/>password is:" + txt2.Text;
         Message.Text = "<br/>Thank you for your comment: " + Comment.Text;
         
      }

      protected void Check_Change(Object sender, EventArgs e)
      {

         Comment.Wrap = WrapCheckBox.Checked;
         Comment.ReadOnly = ReadOnlyCheckBox.Checked;
         
      }

   </script>
</head>
<body>
    <form id="form1" runat="server">
    <div>
    
     Username:<asp:TextBox ID="txt1" runat="server" TextMode="SingleLine"></asp:TextBox>
      </br> </br>
      Passowrd:<asp:TextBox ID="txt2" runat="server" TextMode="Password" ></asp:TextBox>
      </br>
      <h3> MultiLine TextBox Example </h3>


      Please enter a comment and click the submit button. 

      <br /><br /> 

      <asp:TextBox ID="Comment"
           TextMode="MultiLine"
           Columns="50"
           Rows="5"
           runat="server"/>

      <br />

      <asp:RequiredFieldValidator
           ID="Value1RequiredValidator"
           ControlToValidate="Comment"
           ErrorMessage="Please enter a comment.<br />"
           Display="Dynamic"
           runat="server"/>                         

      <asp:CheckBox ID="WrapCheckBox"
           Text="Wrap Text"
           Checked="True"
           AutoPostBack="True"
           OnCheckedChanged="Check_Change"
           runat="server"/>

      &nbsp;&nbsp;

      <asp:CheckBox ID="ReadOnlyCheckBox"
           Text="ReadOnly"
           Checked="False"
           AutoPostBack="True"
           OnCheckedChanged="Check_Change"
           runat="server"/>

      &nbsp;&nbsp;
      
      <asp:Button ID="SubmitButton"
           Text="Submit"
           OnClick="SubmitButton_Click"
           runat="server"/>

      <hr />
      <asp:Label ID="username"
           runat="server"/>
           <asp:Label ID="password"
           runat="server"/>
      <asp:Label ID="Message"
           runat="server"/>
 </div>
   </form>
</body>
</html>

row.aspx.cs

using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;

namespace our_program
{
    public partial class row : System.Web.UI.Page
    {
        protected void Page_Load(object sender, EventArgs e)
        {

        }
    }
}

No comments:

Post a Comment