Explained: Forms Authentication in ASP.NET 2.0
原地址:
http://msdn.microsoft.com/en-us/library/aa480476.aspx
IIS Authentication
ASP.NET authentication is a two-step process. First, Internet Information Services (IIS) authenticates the user and creates a Windows token to represent the user. IIS determines the authentication mode that it should use for a particular application by looking at IIS metabase settings. If IIS is configured to use anonymous authentication, a token for the IUSR_MACHINE account is generated and used to represent the anonymous user. IIS-then passes the token to ASP.NET.
Second, ASP.NET performs its own authentication. The authentication method used is specified by the mode attribute of the authentication element. The following authentication configuration specifies that ASP.NET uses the FormsAuthenticationModule class:
Copy Code
<authentication mode="Forms" />
Note Because forms authentication does not rely on IIS authentication, you should configure anonymous access for your application in IIS if you intend to use forms authentication in your ASP.NET application.
ASP.NET Forms Authentication
ASP.NET forms authentication occurs after IIS authentication is completed. You can configure forms authentication with the forms element.
Forms Authentication Configuration
The default attribute values for forms authentication are shown in the following configuration-file fragment.
Copy Code
<system.web>
<authentication mode="Forms">
<forms loginUrl="Login.aspx"
protection="All"
timeout="30"
name=".ASPXAUTH"
path="/"
requireSSL="false"
slidingExpiration="true"
defaultUrl="default.aspx"
cookieless="UseDeviceProfile"
enableCrossAppRedirects="false" />
</authentication>
</system.web>
The default attribute values are described below:
loginUrl points to your application's custom logon page. You should place
相关文档:
1. 打开新的窗口并传送参数 [返回目录]
传送参数:
response.write("<script>window.open('*.aspx?id="+this.DropDownList1.SelectIndex+"&id1="+...+"')</script>")
接收参数:
string a = Request.QueryString("id");
string b = Request.QueryString("id1");
2.为按钮 ......
一直以来将数据库中的时间绑定到gridview中后,显示的后面总是会多出一串00:00:00,
原来是绑定的时候没有格式化字符串,只要在绑定时加入如下格式就对了。
<asp:BoundField DataField="FieldName" HeaderText="时间" DataFormatString="{0:d}" HtmlEncode="false"> ......
很多人都向在服务器端调用客户端的函数来操作,也就是在asp中调用javascript脚本中已经定义好的脚本函数。经过研究,发现了一些勉强的方法。
1. 用Response.Write方法写入脚本
比如在你单击按钮后,先操作数据库,完了后显示已经完成,可以在最后想调用的地方写上
Response.Write("<script type='text/javascrip ......
测试环境:windows server 2003+visual studio 2008
''' <summary>
''' 获取Excel文件所有工作表的名称
''' </summary>
''' <param name="iSubPath">Excel文件路径,如:D:\test.xls</param>
  ......
问题描述:
数据库A表中:
ID Name
1 小明
2 小强
3 小张
4 小李
5 小关
...
分别有Label1,Label2... Label5 五个标签,怎么让这五个标签Text绑定显示A表Name列的前5个,就是说Label1显示小明,Label2显示小强...
......