排序測試時間

            System.Diagnostics.Stopwatch stopwatch = new Stopwatch();            stopwatch.Start(); //  開始監視代碼已耗用時間            //  you code ....            stopwatch.Stop(); //  停止監視            TimeSpan timespan = stopwatch.Elapsed; // 

IsPostBack的使用

1.第一次載入頁面時Page.ispostback是false,當觸發該頁面的web控制項時,產生回傳,這時候 該屬性會是true,所以要用if(!IsPostback)來判斷,只在第一次進入頁面時載入資料。2.放在使page_load裡的代碼只執行一遍3.Page.IsPostBack 屬性擷取一個值,該值指示該頁是否正為響應用戶端回傳而載入,或者它是否正被首次載入和訪問。

關於scrollHeight設定彈出層時背景變灰(相容問題)

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);

colorbox學習筆記–iframe內嵌頁面調用父頁面colorbox

常常用到iframe內嵌另一個頁面,而這個頁面裡顯示圖片,當點擊這個內嵌頁面中的圖片,讓他在父級頁面顯示colorbox的效果1.首先iframe內頁面額代碼js: function colorBox() { var url = document.getElementById("bigPic").src; window.parent.showBigPic(url); }html:<img id="bigPic" src="<%

擷取ashx得到的內容

要擷取一個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"

滑鼠移動div

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);

添加收藏夾(相容部分)

<script type="text/javascript">         function addFav() {   // 加入收藏夾              if (document.all) {                 window.external.addFavorite('http://www.cnblogs.com/wuchao/’, 'wuchaode blog');             }             else

字型滾動多種方法

1.<marquee id="mar1" scrollAmount="2" direction="up" height="100" onmouseout="scollStart()" onmouseover="scollStop()">內容顯示</marquee>marquee

萬能簡單GridView分頁代碼

<asp:GridView ID="GridViewHistory" runat="server" AutoGenerateColumns="False"             CssClass="vip_table" GridLines="None" BorderStyle="None" CellPadding="0"             ShowHeader="False" AllowPaging="true" PageSize="20"         

js、jquery中select的用法

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 =

window.frames["Iframe1"].document.location相容問題

 在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"

colorbox學習–作為照片查看的jquery模版

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>

關於使用者退出,點擊瀏覽器後退仍可回到原來頁面解決二

解決方案1:禁用緩衝,前一次使用的方法,在電腦上各瀏覽器都沒問題,但在ipad、安卓手機上仍有問題解決方案2:禁用瀏覽器後退鍵 javascript: window.history.forward(1);

listview裡的button事件

1.<asp:ListView ID="lvBalance" runat="server" >                                 <LayoutTemplate>                                     <div id="listDiv" style="width:100%;overflow-y:auto;">                                     

js導覽列處於選中狀態

<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&

string時間轉換為時間格式

public string formatDataStr(string objstring)         {             if (objstring == "" || objstring == null || objstring == ".")             {                 return "";             }             else             {            

尋找GridView裡的textbox控制項

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; /

主版頁面導覽列選中解決方案

html代碼:<div id="nav_content">            <ul>                <li id="default"><a href="default.html">首頁</a></li>                <li><a href="saleCar.html">我要賣車</a></li>           

jqplot為網站添加圖表

<html xmlns="http://www.w3.org/1999/xhtml"><head runat="server"> <title></title> <!--[if lt IE 9]><script language="javascript" type="text/javascript"

js時間轉換+比較 Date.parse的相容

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) {    

總頁數: 61357 1 .... 8497 8498 8499 8500 8501 .... 61357 Go to: 前往

聯繫我們

該頁面正文內容均來源於網絡整理,並不代表阿里雲官方的觀點,該頁面所提到的產品和服務也與阿里云無關,如果該頁面內容對您造成了困擾,歡迎寫郵件給我們,收到郵件我們將在5個工作日內處理。

如果您發現本社區中有涉嫌抄襲的內容,歡迎發送郵件至: info-contact@alibabacloud.com 進行舉報並提供相關證據,工作人員會在 5 個工作天內聯絡您,一經查實,本站將立刻刪除涉嫌侵權內容。

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.