PDA

View Full Version : یه سوال ساده asp.net



mamadco
یک شنبه 26 مرداد 1393, 23:40 عصر
سلام استاید محترم ، من تازه کارم
میخواستم ببینم ، چطوری تو کد هایی که وارد کردم کاری کنم که به جای نمایش پسورد متنی با عنوان مثلا "پسورد انتخابی" نمایش بده .

و دیگه چطوری دوباره پسورد رو به صورت متن پسورد دار نمایش بده .


<%@ Page Language="C#" AutoEventWireup="true" CodeFile="Default.aspx.cs" Inherits="_Default" %>

<!DOCTYPE html>

<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
<title></title>
<style type="text/css">
.auto-style1 {
width: 100%;
}
.auto-style2 {
width: 152px;
}
.auto-style3 {
width: 152px;
height: 32px;
}
.auto-style4 {
height: 32px;
}
</style>
</head>
<body>
<form id="form1" runat="server">
<div>

<table class="auto-style1">
<tr>
<td class="auto-style2">username :</td>
<td>
<asp:TextBox ID="txtusername" runat="server"></asp:TextBox>
</td>
</tr>
<tr>
<td class="auto-style3">password :</td>
<td class="auto-style4">
<asp:TextBox ID="txtpassword" runat="server" TextMode="Password"></asp:TextBox>
</td>
</tr>
<tr>
<td class="auto-style2">Email :</td>
<td>
<asp:TextBox ID="txtemail" runat="server" TextMode="Email"></asp:TextBox>
</td>
</tr>
<tr>
<td class="auto-style3">
<asp:Button ID="btnsub" runat="server" Text="Button" />
</td>
<td class="auto-style4"></td>
</tr>
<tr>
<td class="auto-style2">username :</td>
<td>
<asp:Label ID="viewusername" runat="server" Text=""></asp:Label>
</td>
</tr>
<tr>
<td class="auto-style2">password :</td>
<td>
<asp:Label ID="viewpassword" runat="server" Text=""></asp:Label>
</td>
</tr>
<tr>
<td class="auto-style2">Email</td>
<td>
<asp:Label ID="viewemail" runat="server" Text=""></asp:Label>
</td>
</tr>

</table>

</div>
</form>
</body>
</html>



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

public partial class _Default : System.Web.UI.Page
{
protected void Page_Load(object sender, EventArgs e)
{
viewusername.Text = txtusername.Text;
viewpassword.Text = txtpassword.Text;
viewemail.Text = txtemail.Text;
}
}

notlikeothers
دوشنبه 27 مرداد 1393, 00:29 صبح
<asp:TextBox ID="txtemail" runat="server" TextMode="Email" placeholder="yourtext"></asp:TextBox>