Time of Update: 2018-12-06
System.Diagnostics.Stopwatch stopwatch = new Stopwatch(); stopwatch.Start(); // 開始監視代碼已耗用時間 // you code .... stopwatch.Stop(); // 停止監視 TimeSpan timespan = stopwatch.Elapsed; //
Time of Update: 2018-12-06
1.第一次載入頁面時Page.ispostback是false,當觸發該頁面的web控制項時,產生回傳,這時候 該屬性會是true,所以要用if(!IsPostback)來判斷,只在第一次進入頁面時載入資料。2.放在使page_load裡的代碼只執行一遍3.Page.IsPostBack 屬性擷取一個值,該值指示該頁是否正為響應用戶端回傳而載入,或者它是否正被首次載入和訪問。
Time of Update: 2018-12-06
1.css代碼:html,body{height:100%;} //考慮到內容很少時,body無法布滿整個網頁#vip_div { position:absolute; top:0; left:0; width:100%; display:none; z-index:20; background-color: #C0C0C0; opacity:0.6; filter:alpha(opacity=60);
Time of Update: 2018-12-06
常常用到iframe內嵌另一個頁面,而這個頁面裡顯示圖片,當點擊這個內嵌頁面中的圖片,讓他在父級頁面顯示colorbox的效果1.首先iframe內頁面額代碼js: function colorBox() { var url = document.getElementById("bigPic").src; window.parent.showBigPic(url); }html:<img id="bigPic" src="<%
Time of Update: 2018-12-06
要擷取一個ashx頁面的到的資料,使用以下方法:1.後台代碼:WebClient wc = new WebClient(); Byte[] pageData = wc.DownloadData("http://xxxx.com"); hd_num.Value = Encoding.Default.GetString(pageData);前台代碼:<asp:HiddenField ID="hd_num" runat="server"
Time of Update: 2018-12-06
js:var isDrag = 0;var divMove; var divAndMouseX;//滑鼠落點距離div左上方x座標的差距 var divAndMouseY;//滑鼠落點距離div左上方y座標的差距 function down(div) { isDrag = 1; divMove = div; divAndMouseX = event.clientX - parseInt(document.getElementById(div).offsetLeft);
Time of Update: 2018-12-06
<script type="text/javascript"> function addFav() { // 加入收藏夾 if (document.all) { window.external.addFavorite('http://www.cnblogs.com/wuchao/’, 'wuchaode blog'); } else
Time of Update: 2018-12-06
1.<marquee id="mar1" scrollAmount="2" direction="up" height="100" onmouseout="scollStart()" onmouseover="scollStop()">內容顯示</marquee>marquee
Time of Update: 2018-12-06
<asp:GridView ID="GridViewHistory" runat="server" AutoGenerateColumns="False" CssClass="vip_table" GridLines="None" BorderStyle="None" CellPadding="0" ShowHeader="False" AllowPaging="true" PageSize="20"
Time of Update: 2018-12-06
1.jsvar obj=document.getElementById(selectid);obj.options.length = 0; //清除所有內容obj.options[index] = new Option("three",3); //更改對應的值obj.options[index].selected = true; //保持選中狀態obj.add(new Option("4","4")); ”文本",”值"var index =
Time of Update: 2018-12-06
在ie中使用window.frames["Iframe1"].document.location="";無任何問題,可在Google中出現location未定義錯誤其真正原因還在瀏覽器的核心不一樣,參照:http://blog.csdn.net/lzy_1515/article/details/6045629所以將iframe的id和name設成一樣的即可<iframe frameborder="0" id="Iframe1" name="Iframe1" scrolling="yes"
Time of Update: 2018-12-06
1.官網:http://www.jacklmoore.com/colorbox2.使用方法推薦:http://blog.csdn.net/houpengfei111/article/details/80011873.自己簡單使用:1.yinyong<script src="http://www.cnblogs.com/public/JsEasyUi/js/jquery-1.4.4.min.js" type="text/javascript"></script>
Time of Update: 2018-12-06
解決方案1:禁用緩衝,前一次使用的方法,在電腦上各瀏覽器都沒問題,但在ipad、安卓手機上仍有問題解決方案2:禁用瀏覽器後退鍵 javascript: window.history.forward(1);
Time of Update: 2018-12-06
1.<asp:ListView ID="lvBalance" runat="server" > <LayoutTemplate> <div id="listDiv" style="width:100%;overflow-y:auto;">
Time of Update: 2018-12-06
<div id="nav"><ul><li><a href="/index.shtml">首頁</a></li><li><a href="/layout/index.shtml">CSS版式布局</a></li><li><a href="/div_css/index.shtml">DIV+CSS教程</a></li><li&
Time of Update: 2018-12-06
public string formatDataStr(string objstring) { if (objstring == "" || objstring == null || objstring == ".") { return ""; } else {
Time of Update: 2018-12-06
1.取值確定TextBox在GridView的第幾列,注意:GridView的列是從0開始計數的,第一列的索引就是0,加入TextBox在第一列,那麼我們可以這樣for(int i=0;i<this.GridView1.Rows.Count;i++){ TextBox txt = (TextBox)this.GridView1.Rows[i].Cells[0].FindControl("TextBox1"); if(txt != null){string str = txt.Text; /
Time of Update: 2018-12-06
html代碼:<div id="nav_content"> <ul> <li id="default"><a href="default.html">首頁</a></li> <li><a href="saleCar.html">我要賣車</a></li>
Time of Update: 2018-12-06
<html xmlns="http://www.w3.org/1999/xhtml"><head runat="server"> <title></title> <!--[if lt IE 9]><script language="javascript" type="text/javascript"
Time of Update: 2018-12-06
var tip = setInterval("checkTime()", "10000"); var temp = document.getElementById("hidden_endT").value; var datereturn = toDate(temp); function checkTime() { var myTime=Date(); if (Date.parse(myTime) > datereturn) {