GridView中資料列的內容太長的時候經常會出現換行
轉換成模板列,在內容兩邊加上 <nowrap> </nowrap>
讓 FileUpload 文字框唯讀
-
C# code
-
<asp:FileUpload runat="server" style="height:20px;" unselectable="on" ID="fileUpdate" />
Cookie中的資料以文本的形式存在用戶端電腦,考慮它的安全性,最好在將資料存入Cookie之前對其進行加密。
加密的方法很多,比較簡單一點的有:Base64,md5,sha等,而相對比較複雜一點的有:DES,TripleDES,RC2,Rijndael等。
下面是的代碼實現了將資料存入Cookie之前採用散列的演算法進行加密.
Private void Login_Click(object sender,System EventArgs e)
{
string Name = NameBox.Text;
string Pass = PassBox.Text;
Response.Cookies[ "name "].Value = FormsAuthentication.HashPasswordForStoringInConfigFile(Name, "md5 ");
Response.Cookies[ "pass "].Value = FormsAuthentication.HashPasswordForStoringInConfigFile(Pass, "md5 ");
}
加密的方法很多,使用比較複雜的密碼編譯演算法,安全性比較高些,但佔用伺服器資源比較大,會減慢整個網站的訪問速度。
所以對Cookie加密在考慮三個方面:1:安全性,2:Cookie容量,3:整個網站的效能。
ENTER鍵可以讓游標移到下一個輸入框
<input onkeydown= "if(event.keyCode==13)event.keyCode=9 ">
<%@ Page Language="C#" AutoEventWireup="true" CodeFile="26_虛線效果.aspx.cs" Inherits="_26_虛線效果" %><!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"><html xmlns="http://www.w3.org/1999/xhtml" ><head runat="server"><title>無標題頁</title><%-- 方法二--%><STYLE type=text/css>.dotline {BORDER-BOTTOM-STYLE: dotted; BORDER-LEFT-STYLE: dotted; BORDER-RIGHT-STYLE: dotted; BORDER-TOP-STYLE: dotted}</STYLE></head><body><form id="form1" runat="server"><div><hr style="BORDER-BOTTOM-STYLE: dotted; BORDER-LEFT-STYLE: dotted; BORDER-RIGHT-STYLE: dotted; BORDER-TOP-STYLE: dotted" color=#000000 size=1 />方法2:<hr class=dotline color=green size=1 /></div></form></body></html>
<input type= "file " onchange= "javascript:document.getElementById( 'image ').src=this.value "/>
<input type= "image " src= " " id= "image "/>
這樣在選中要上傳的圖片時,就可以看見自己要上傳的了