Time of Update: 2018-12-04
<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="WebForm2.aspx.cs" Inherits="STCP.TP.WebForm2" %><!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"><html
Time of Update: 2018-12-04
1.超連結訪問過後hover樣式就不出現的問題被點擊瀏覽過的超連結樣式不在具有hover和active了,很多人應該都遇到過這個問題,解決方案是改變CSS屬性的排列順序: L-V-H-ACode: <style type="text/css"><!-- a:link {}a:visited {}a:hover {}a:active {}--></style> 2.FireFox下如何使連續長欄位自動換行眾所周知IE中直接使用 word-wrap:break-
Time of Update: 2018-12-04
用到兩個頁面1、上傳處理頁面upload.aspx,該頁面只一FileUpload控制項和一個Button按鈕 <form id="form1" runat="server"> <div> <asp:FileUpload ID="FileUpload1" runat="server" /> <asp:Button ID="Button1" runat="server"
Time of Update: 2018-12-04
在csdn上看到這段代碼,很不錯,貼上來儲存著,用using比較直觀的知道資源何時釋放。習慣用close()方法來釋放SqlParameter[] signOnParms = GetSignOnParameters(); SqlParameter[] accountParms = GetAccountParameters(); SqlParameter[] profileParms = GetProfileParameters();
Time of Update: 2018-12-04
在一般有使用者登入的網站中,都會有需要使用者登入後才能操作的頁面,如果在使用者登入後能跳轉到之前的頁面,就會給使用者一個很好的體驗,也能讓他們更容易的瀏覽要操作的頁面。這中間主要用到的是擷取Url參數,擷取後用於跳轉。主要實現步驟:為了能很好的說明,主要已兩個頁面為例,order.aspx,login.aspx1、order.aspx,實現訂單頁面,主要功能是實現使用者在選定商品時提交訂單,但使用者必須登陸後才能實現提交的功能,這樣才知道是哪個買的嘛。。
Time of Update: 2018-12-04
Razor的出現,使頁面看起更加簡潔,Razor的頁面尾碼為:.cshtmlRazor基礎文法:1、代碼注釋: 多行注釋: @*注釋資訊*@ 單行注釋: // 注釋 1、代碼體{...}@{var x=100;var y=100;string str="this is string";}在代碼體中,沒一行都需要用";"結束,代碼區中,字母區分大小寫。字元類型常量必須用""括起來,2、
Time of Update: 2018-12-04
轉個gridView沒資料顯示無任何記錄的代碼 // 參數:所要綁定的GridView 所要繫結資料集 ,dataTable dt資料集中的資料表 public static void BindNoRecords(GridView gridView, DataTable dt) { if (dt.Rows.Count == 0) { dt.Rows.Add(dt.NewRow()
Time of Update: 2018-12-04
開發環境:vs2010+.net 4.0+jquery.4.0 1、建立WCF服務 直接在網站中添加 Ajax-enabled-WCF Services ,命名為AjaxWcfServices.svc。在App_Code下產生AjaxWCFService.cs檔案。 AjaxWCFService.cs代碼如下:using System;using System.Collections.Generic;using System.Linq;using
Time of Update: 2018-12-04
一、建立1.以管理員身份運行開啟cmd視窗。2.輸入netsh wlan set hostednetwork mode=allow ssid=Alex key=password_me"其中ssid是wifi的名字,key是wifi的密碼如果提示成功,那就說明虛擬wifi建立好了。3.輸入netsh wlan start hostednetwork若果提示成功,則說明wifi已經正常啟動。3.現在虛擬wifi已經建立成功並且成功啟動,接下來我們要讓這個虛擬wifi能夠串連到internet。進入
Time of Update: 2018-12-04
有一年沒碰.net了,基本上所有的都忘記得差不多了。這幾天重新熟悉這個,首先熟悉下用sqlhelper和Property屬性類進行添加操作。1、定義屬性 using System;namespace shop.Model{ [Serializable] /// <summary> /// 訂單資訊屬性 訂單實體 /// </summary> public class order { private int
Time of Update: 2018-12-04
gridView 複選框 實現全選 一定不要忘記看設定複選框的auto為真 /// <summary> /// /// 取消全選 /// </summary> /// <param name="sender"></param> /// <param name="e"></param> protected void btnCancel_Click(object sender,
Time of Update: 2018-12-04
一個gridView自訂樣式 css樣式為:.GridViewStyle{ font-family: Arial, Sans-Serif; font-size:small; table-layout: auto; border-collapse: collapse; border:#B3D08F 1px solid;}/*Header and Pager
Time of Update: 2018-12-04
1.select * from Table where datediff(month,SignTime,'2011-08-18 16:16:16')=0 -得出當月的 該語句把資料庫表table裡面的SignTime的08月的資料都都查詢出來了2.select CONVERT(varchar(12) , SignTime, 108 ) from Table --得出時分秒的該語句把資料庫表table裡面的SignTime的時分秒顯示出來3.convert(datetime,“12:12:12
Time of Update: 2018-12-04
頭幾天遇到了一個對下拉式清單綁定的問題用sqldatareader作為資料來源。綁定很容易實現。對綁定了資料來源後在添加一個資料項目代碼記錄下: ddlType.DataSource = sdr; ddlType.DataValueField = "menuID";//value值 ddlType.DataTextField = "menuTitle";//顯示文本 ddlType.DataBind();
Time of Update: 2018-12-04
<!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><meta http-equiv="Content-Type" content="text/html;
Time of Update: 2018-12-04
這兩天做一個資料管理系統,邊學邊做,以前寫的關於資料庫操作的,都沒用到預存程序,這幾天學會了怎麼用預存程序,總算有點收穫 ^_^。下面是一個預存程序使用過程在使用儲存語句時,它包含了兩種特殊的表:inserted表和Deleted表。Inserted和deleted表主要用於觸發器中。 擴充表間參考完整性
Time of Update: 2018-12-04
DataTable dt=ds.Tables[0]; DataColumn[] dcs ={ dt.Columns["newsID"] }; dt.PrimaryKey = dcs;//設為主鍵一定要設的 DataRow dr = dt.Rows.Find(14);//根據id值(14)查詢該行的資料 int count=dt.Rows.Count;//記錄總數 int index=dt.Rows.IndexOf(dr);//
Time of Update: 2018-12-04
<!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><meta http-equiv="Content-Type" content="text/html;
Time of Update: 2018-12-04
利用datatable 簡單的xml讀寫 string str = "select top 5 * from AD where adType='輪換'"; DataSet ds = SqlHelper.ExecuteDataset(SqlHelper.ConnectionStringCdsh, CommandType.Text, str); XmlDocument doc = new XmlDocument();
Time of Update: 2018-12-04
緩衝——能很好的提高網站的效能。在訪問量大,但更新較少的網站中使用緩衝,可以大大提高運行效率;在.net中給我們提供了很好的緩衝機制,頁面緩衝、資料緩衝,還有很好的依賴緩衝。依賴緩衝好處就是,跟相依賴的項的改變有關,比如cacheTable表有資料改變時,資料已經緩衝了的就會被清楚,重新讀取新的資料,能保持資料的即時更新。頭幾天學習了下sql 依賴緩衝,實現過程和步驟記錄下:環境:windows 2003+IIS6