using System.Text.RegularExpressions;
//檢查客戶端瀏覽器及版本。
if (!new Regex("MSIE [6789]").IsMatch(Request.UserAgent.ToUpper()))
{
Response.Redirect("../OpenResources/improperBrowser.htm", true);
}
<a href="Default.aspx" class="text">Store Main Page</a>
//定義連接 傳值
<area href="Category.aspx?category_id=BIRDS" alt="Birds" coords="408,133,514,239" shape="RECT">
//獲取傳過來的值 並顯示
lblPage.Text = Request.QueryString["category_id"];
//獲取一個值指示該頁面驗證是否成功
if (Page.IsValid == true)
//判斷ID值是否爲--空字符串,此字段爲只讀字段
if (customerID == string.Empty)
//md5 密碼加密,必須加此命名空間才能引用FormsAuthentication類
using System.Web.Security;
PassWord = FormsAuthentication.HashPasswordForStoringInConfigFile(PassWord, "md5").ToLower().Substring(8, 16);
//彈出窗口並關閉
Response.Write("<script>alert('彈出窗口');history.back();</script>");
Response.End();
//轉換日期格式 或 {0:D}
Convert.ToDateTime(dr["UpDataTime"]).ToLongDateString()
//加入收藏
[<A href="javascript:window.external.addFavorite('http://www.cfedu.net','赤峯教育網');">加入收藏</A>]
//QQ留言
<A href="http://wpa.qq.com/msgrd?V=1&Uin=1310800&Site=www.cfedu.net&Menu=yes"
target="blank"><IMG alt="點擊給我QQ留言" src="Images/8_offline.gif" border="0"></A>
//在一個容器內找到控件,並轉換類型
(類名)FindControl("要查找的ID")
//在Respeater控件 傳值 並轉換類型
<td><a href='<%# "ShowNew.aspx?FileTitle=" +Server.UrlEncode((string)DataBinder.Eval(Container.DataItem,"FileTitle"))%>'><%# DataBinder.Eval(Container.DataItem, "FileTitle")%></a>
<tr style="background:#FFFFFF" onMouseOut="this.style.backgroundColor='#FFFFFF'" onMouseOver="this.style.backgroundColor='#F2F2F2'">
<td></td>
<td></td>
<td></td>
</tr>