熱點推薦:
您现在的位置: 電腦知識網 >> 編程 >> .NET編程 >> 正文

在ASP.NET中創建安全的web站點[3]

2013-11-13 12:20:21  來源: .NET編程 

  解決了上面兩個問題相信大家心裡一定有底了吧!下面就開始實現loginaspx頁面利用C#和SQL Server創建一個webform頁面加入相應的控件具體代碼如下

<%@ Page language=c# Codebehind=loginaspxcs

AutoEventWireup=false Inherits=securelogin %>

<!DOCTYPE HTML PUBLIC //WC//DTD HTML Transitional//EN >

<HTML>

<HEAD>

<title>Secure Site</title>

<meta content=Microsoft Visual Studio name=GENERATOR>

<meta content=C# name=CODE_LANGUAGE>

<meta content=javascript name=vs_defaultClientScript>

<meta content=http://schemasmicrosoftcom/intellisense/ie

name=vs_targetSchema>

</HEAD>

<body MS_POSITIONING=GridLayout>

<form id=login method=post runat=server>

<table cellSpacing= cellPadding= border=>

<tr>

<td vAlign=top align=left>

<asp:label id=Message Runat=server ForeColor=#ff>

</asp:label>

</td>

</tr>

<tr>

<td vAlign=top align=left>

<b>Email:</b>

</td>

</tr>

<tr>

<td vAlign=top align=left>

<asp:textbox id=username Runat=server Width=>

</asp:textbox>

</td>

</tr>

<tr>

<td vAlign=top align=left>

<b>Password:</b>

</td>

</tr>

<tr>

<td vAlign=top align=left>

<asp:textbox id=password Runat=server

Width= TextMode=Password>

</asp:textbox>

</td>

</tr>

<tr>

<td vAlign=top align=left>

<asp:checkbox id=saveLogin Runat=server

Text=<b>Save my login</b>>

</asp:checkbox>

</td>

</tr>

<tr>

<td vAlign=top align=right>

<asp:imagebutton id=btnLogin Runat=server

ImageUrl=/images/wk/login/btnLogingif>

</asp:imagebutton>

</td>

</tr>

</table>

</form>

</body>

</HTML>

   

[]  []  []  []  


From:http://tw.wingwit.com/Article/program/net/201311/15689.html
    推薦文章
    Copyright © 2005-2013 電腦知識網 Computer Knowledge   All rights reserved.