原创 c# 彈出確認框
protected void Page_Load(object sender, EventArgs e) { if (!this.IsPostBack) {
原创 快速將網頁改爲黑白色調
1.找到頁面所引用的css文件 2.在body加入代碼: -webkit-filter: grayscale(100%);
原创 JQuery根據關鍵字檢索html元素並篩選顯示
背景:實際上就是在文本框中輸入關鍵字,通過關鍵字檢索html元素,篩選後顯示在界面上。 Html元素如下: <div> <input type="text" id="searchBox"/> <ul id
原创 jQuery hover延時觸發
$('.grow').hover(function(){ var _this = $(this); // 把$(this)對象賦給一個變量 trigger = setTimeout(
原创 sqlserver 判斷字段是否爲空字符串或者null
isnull(字段,'')<>'' 表示不爲null且不爲‘’ not(字段 is null) 表示不爲null
原创 asp .net 獲取客戶端IP地址,瀏覽器類型及版本號以及使用的平臺名稱
/// <summary> /// 獲取客戶端IP地址(無視代理) /// </summary> /// <returns>若失敗則返回回送地址</returns> public static s
原创 c# ascx控件中 js 登錄後跳轉到之前的頁面
情況:index.aspx 中有個iframe(login.aspx),login.aspx頁面有2個ascx控件,在其中一個ascx控件中跳到index.aspx 在ascx.cs中使用了很多種的刷新頁面的方法都失敗了,最後嘗試下面的方
原创 如何解決“Flash Player與您的地區不相容”?
打開“計算機”搜索“pepflashplayer.dll”文件 2等待搜索結束後,刪除所有“pepflashplayer.dll”文件 3卸載flash player 請參閱:如何正確卸載Flash Player 4打開fl
原创 Asp.net動態添加meta標籤
原文鏈接:https://shiyousan.com/post/635575544520262037 具體代碼如下: HtmlMeta hmKeyWords = new HtmlMeta();
原创 C#後臺如何獲取HTML單選框radio的值(在後臺生成的控件)
A:"<input type=\"radio\" name=\"item_" + tid + "\" value=\"" + reid + "\" runat=\"server\" id=\"ra_" + reid + "\">";
原创 使用Html Agility Pack快速實現解析Html(C#)
傳統解析html標籤的方式是利用HttpWebRequest獲取html字符串,然後通過正則表達式進行解析,但是這種方式比較麻煩。有沒有更簡單的方式呢?有,那就是Html Agility Pack,它可以做到像用XmlDocument類來
原创 C# WinForm 判斷程序是否已經在運行,且只允許運行一個實例
static class Program { /// <summary> /// 應用程序的主入口點。 /// </summary> [STAThread] static void Main() { Ap
原创 VS2012 IIS Express 添加MIME映射(.json)
1.在DOS窗口下進入IIS Express安裝目錄,默認是“C:\Program Files\IIS Express”,cmd 命令行cd 到 該目錄下 2.在IIS Express安裝目錄下執行命令:appcmd set conf
原创 .net Iframe 'X-Frame-Options' to 'SAMEORIGIN' 解決辦法
Refused to display 'http://xxx.cn/' in a frame because it set 'X-Frame-Options' to 'sameorigin'. 證明此頁面不能被Iframe 解決方法: 1
原创 .net MVC 設置表單允許提交Html
Asp.net表單驗證功能是爲了防止http請求中包含惡意內容,如html,js。 當業務需要允許錄入此類內容時可以做一下設置: 1.關閉表單的驗證([ValidateInput(false)]) [HttpPost] [Validat