Time of Update: 2018-12-08
讓瀏覽器做緩衝需要給瀏覽器發送指定的Http頭,告訴瀏覽器緩衝多長時間,或者堅決不要緩衝。作為.net的程式員,其實我們一直都在用這種方法,在OutputCache指令中指定緩衝的Location為Client時,其實就是給瀏覽器發送了一個Http頭,告訴瀏覽器這個Url要緩衝多長時間,最後修改的時間。 微軟在OutputCacheModule中對這些緩衝用到的Http頭給我們進行了很好的封裝,但是瞭解這些Http頭可以更靈活的使用它們。 和用戶端緩衝相關的Http頭有以下幾個,分別是: 1.
Time of Update: 2018-12-08
錯誤資訊如下:寫了如下的一個方法來返回資料操作影響的行數:如下 複製代碼 代碼如下:private int GetReturnValue(string sStr, string conn) { OleDbConnection odbconn = AccessHelp(conn); OleDbCommand odbcmd = new OleDbCommand(sStr, odbconn); return odbcmd.ExecuteNonQuery(); } 用下面的一個方法來調用這個類:
Time of Update: 2018-12-08
要實現上述效果 複製代碼 代碼如下:public static string ShowNewMsg() { string Pic1 = "images/yzdp-_15.gif"; string Pic2 = "images/yzdp-_18.gif"; string Pic3 = "images/yzdp-_20.gif"; string Pic4 = "images/yzdp-_22.gif"; string Pic5 = "images/yzdp-_24.gif"; string Pic6
Time of Update: 2018-12-08
1.首頁選擇HTML原型網頁 然後再該HTML網頁添加一些自認為特別的標記,已便到時候靜態化的時候系統能更精確的進行操作! 2.擷取HTML網頁代碼 我選擇的是通過FileUpload控制項進行擷取靜態度頁面模型,進行儲存! 複製代碼 代碼如下:if (FileUpload1.PostedFile.FileName == "") { Response.Write("<script>alert('請確定您是否選擇了網頁')</script>"); return; } if
Time of Update: 2018-12-08
函數可以參考:複製代碼 代碼如下:<% '註冊論壇使用者,參數說明 'username 使用者登入名稱稱 'password 使用者有登入密碼 'groupid 使用者組id,進階會員,使用者組id為17;正式會員,使用者組id為18;普通會員,則使用者組id為10 'email,realname,mobile,phone 電子郵件,真實姓名,手機,電話 sub
Time of Update: 2018-12-08
經過尋找網上的資料,發現好像是它本身的一個問題,原文如下: With ASP.Net, I need to submit twice when using the RequiredFieldValidator in a FCKeditor instance FCKeditor will not work properly with the Required Field Validator when the "EnableClientScript" property of the
Time of Update: 2018-12-08
第一種方法: 通過URL連結地址傳遞 send.aspx: 複製代碼 代碼如下:protected void Button1_Click(object sender, EventArgs e) { Request.Redirect("Default2.aspx?username=honge"); } receive.aspx: 複製代碼 代碼如下:string username = Request.QueryString["username"];這樣可以得到參數值。 第二種方法:
Time of Update: 2018-12-08
1、資訊表建立立一個欄位,並用0、1的方法判斷資訊的狀態。 2、建立一個頁面,定時重新整理,並查詢表中是否有欄位值為0的記錄。 3、當管理員點擊查看該資訊的時候,將欄位值改為1。 其中最關鍵的是第2步,下面給出所需代碼 定時重新整理指定頁面。比如建立的頁面叫a.asp 那麼就是<script>setTimeout("location.href="a.asp'",10000)</script> 資料庫連接。 <%set rs =
Time of Update: 2018-12-08
前台代碼複製代碼 代碼如下::<%@ Page Language="C#" AutoEventWireup="true" CodeFile="Default.aspx.cs" Inherits="_Default" %> <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
Time of Update: 2018-12-08
而且要有圖片的說明資訊,還可以點上一幅和下一幅等進行翻頁。 實現過程如下: pic_small.Aspx頁面縮圖處的代碼為: 複製代碼
Time of Update: 2018-12-08
1. ASP.NET AJAX 中,如何用 JavaScript 調用伺服器端的方法? 這裡不是指調用簡單的 PageMethod,因為靜態方法是不能操作當前頁面的控制項的,所以靜態 PageMethod 作用就跟普通的 WebService 一樣,比較局限。 那麼,調用一般的伺服器端方法,其實就是發起一個非同步回調。最簡單的實現辦法,是通過 UpdatePanel 來做。 首先定義一個隱藏的 LinkButton,在其處理事件中,去調用我們要執行的操作: 複製代碼
Time of Update: 2018-12-08
需要兩個類 1.typeFiles.cs複製代碼 代碼如下:using System; namespace Model { /// <summary> /// typeFiles 的摘要說明。 /// </summary> public class typeFiles { private object _Fkey; private object _Fvalue1; private object _Fvalue2; public object Fkey { get {
Time of Update: 2018-12-08
一名入門的asp.net程式員應該掌握的知識: (1)熟練使用Sql Server中企業管理器、查詢分析器和事件探查器,能熟練編寫T-SQL、預存程序、使用者自訂函數、視圖、觸發器; (2)瞭解ASP.net伺服器控制項的生命週期; (3)熟練掌握HTML,CSS,javascript,xml,Web Service,AJAX; (4)掌握多層結構以及類的設計方法; (5)瞭解網站安全性漏洞相關方面以及最佳化技巧; 1、可以使用抽象函數重寫基類中的虛函數嗎?
Time of Update: 2018-12-08
一.在伺服器端實現 1.這個是在本頁面上的.cs檔案裡寫的 複製代碼 代碼如下:if (resultInt > 0) { //清除驗證碼 ,顯示執行結果,並轉向新的地址 Session["YanZhengMa"] = ""; String caoCode = "if(confirm('提交成功,是否列印'))" + "{" + "window.location.href='printTKZ.aspx?type=BF&BMId=" + _flowidValue
Time of Update: 2018-12-08
using System; using System.Data; using System.Configuration; using System.Web; using System.Web.Security; using System.Web.UI; using System.Web.UI.WebControls; using System.Web.UI.WebControls.WebParts; using System.Web.UI.HtmlControls; using
Time of Update: 2018-12-08
來與大家分享。稍加改造就可以實現更強大的功能了。用下面的代碼就可以簡單的大量匯出picasa相簿的外鏈了。 複製代碼 代碼如下:<%@LANGUAGE="VBSCRIPT" CODEPAGE="65001"%> <% dim xmlget,xmlhttp,email,paswd email="youremail" '輸入picasa的賬戶email paswd="yourpassword" '輸入picasa的密碼 Set
Time of Update: 2018-12-08
先在網站根目錄下建立一個config檔案夾,再在此檔案架下建立一個urls.config檔案,這裡記錄url的配置資訊代碼如下:複製代碼 代碼如下:<?xml version="1.0" encoding="utf-8"?> <urls> <rewrite name="default" path="/default-{0}-{1}.aspx" pattern = "/default-(\d+)(-(\d+))?.aspx" page="/default.aspx"
Time of Update: 2018-12-08
源碼: 複製代碼 代碼如下:<% '隱藏並修改檔案的最後修改時間的aspshell '原理:通過FSO可以修改檔案的屬性,比如設定為唯讀,隱藏,系統等等;FSO中的attributes屬性修改檔案屬性,1隻讀,2隱藏,4系統檔案 ' 通過shell.application可以給檔案重新設定一個最後修改時間 '2009/02/24 write by skyfire response.write "<form method=post>" response.write "路
Time of Update: 2018-12-08
這種方法在《技巧/訣竅:在ASP.NET中重寫URL》這篇文章提到的。簡單的說,大家都知道: 複製代碼 代碼如下:http://www.jb51.net/product.aspx?id=520對搜尋引擎的友好性肯定低於 http://www.jb51.net/product.aspx/520.htm 先截張圖給大家看下: 大家看到可以取得id,而使用的方法也很簡單: Request.PathInfo可以取得url副檔名的附加資訊,就是可以取得/520,但我們只要那個數字,那麼就是複製代碼
Time of Update: 2018-12-08
'''------------------------------------------------------------------------ ''' <summary> ''' 文字列長檢查(按位元組檢查) ''' </summary> ''' <param name="argStrControl">文字列</param> ''' <param name="argLength">文字列長</param> ''' &