學習筆記

//命名空間
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(816);

//彈出窗口並關閉
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&amp;Uin=1310800&amp;Site=www.cfedu.net&amp;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>
發佈了7 篇原創文章 · 獲贊 0 · 訪問量 3萬+
發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章