Time of Update: 2018-12-06
ASP 中也可以用Regex,為了方便使用,對Regex操作進行了封裝,目前只封裝了兩個:1、正則替換Code highlighting produced by Actipro CodeHighlighter (freeware)http://www.CodeHighlighter.com/-->'功能:通過Regex替換字串'參數: str 原字串 ' patton 正則匹配運算式' restr 替換字串' op 選項
Time of Update: 2018-12-06
最近好忙,連續加班好幾周了。雖然辛苦,但卻頗有收穫,最大的收穫是新項目用了ASP.NET MVC。要說的是ASP.Net Mvc 還真好。等項目忙好了,我計劃針對項目中學到的技術點做個總結,寫一些小例子以便日後可以用。 ASP.Net MVC 給我最大的印象是清晰,在寫代碼時不再有傳統ASP.net
Time of Update: 2018-12-06
.Net 網站項目引用類庫時,有時在類庫裡需要調用檔案如xml,此時時檔案路徑比較難找到,研究了一下,暫時得出以下的解決方案。 首先目錄安排如下solution |--project | |--xml | | |--test.xml | |--Class1.cs |--web |--Default.aspx 現在web 引用
Time of Update: 2018-12-06
同事寫的,收錄一下,方法如下: /// <summary> /// 防止重複提交 /// </summary> /// <param name="imaButtons">按鍵集合</param> /// <param name="clientID">頁面有JS驗證的組件</param> public void RepeatSubmitCheckForRC(
Time of Update: 2018-12-06
因為工作需要,和自己MVC的技術不夠純熟,尤其是JS方面.所有又轉回了webfrom開發(其實各有各的好處).很簡單的一個功能,就是為Button控制項添加一個確認提示框,以前記得都是在後台加:btnXXX.Attributes.Add("onclick","if (!confirm(是否確定刪除?')) {return false;}");但是非常奇怪,我加了沒反應.後來發現個更簡單的方法: <asp:Button ID="Button1" runat="server" Text="
Time of Update: 2018-12-06
一直想搞明白大檔案的上傳是怎麼實現的,還有怎麼實現進度條顯示。今天總算在部落格園首頁看到一篇相關的文章。原文地址:asp.net大檔案分塊上傳與進度顯示,完整項目源碼下載了代碼用vs開啟後,裡面的檔案結構:但是工程編譯的時候,出現了問題。就去作者提供的資料找了找,發現了一個學習這方面的一個好地方:http://www.cnblogs.com/stg609/裡面關於大檔案上傳有詳細的介紹,稍稍看了下關於tcp的介紹和asp.net的運行情況,其實之前看過幾次了,權當複習。不過感覺實現大檔案上傳還是
Time of Update: 2018-12-06
1.新的文法,在aspx中設定<%$ ConnectionStrings : NorthwindConnectionString
Time of Update: 2018-12-06
1.控制項的設定焦點可以設定焦點的控制項如下:Button,CheckBox,DropDownList,HyperLink,ImageButton,LinkButton,ListBox,RadioButton,TextBox四種方法,殊途同歸:Page.SetFocus(txtUserID);this.SetFocus(txtUserID);Page.SetFocus(txtUserID.ClientID);txtUserID.Focus();——設定焦點是頁面(Page)級的,自動產生JS:W
Time of Update: 2018-12-06
HtmlHead類動態添加<head>中子標籤,如<title>和<style>,尤其是後者,就是動態配置CSS。例子如下: protected void Page_Load(object sender, EventArgs e) { Style bodyStyle = new Style(); bodyStyle.ForeColor = System.Drawing.Color.Red; bodyStyl
Time of Update: 2018-12-06
在ASP.NET 2.0使用以下四種方式:HyperLinkResponse.Redirect()Server.Transfer()Cross-Page Posting以下只說第四種,即“跨網頁公布”區別於PostBack(只是自己ReCall自己),不再需要URL中的參數QueryString方法1:使用PreviousPage.FindControl訪問來源網頁A的空間屬性屬性。A頁面有TextBoxA,在A頁面的Button上設制PostBackUrl屬性,為B頁面。在B載入頁面時:
Time of Update: 2018-12-06
CodeCode highlighting produced by Actipro CodeHighlighter
Time of Update: 2018-12-06
在asp.net調試javascript代碼主要有以下方法:一、在要調試的javascript代碼前加入debugger,相當於下斷點 注意,這種方式需要在IE的Internet選項中,禁用指令碼調試(Internet
Time of Update: 2018-12-06
FreeTextBox 是一個基於 Internet Explorer 中 MSHTML 技術的 ASP.NET 開原始伺服器控制項。這是一款優秀的自由軟體(Free Software),我們可以輕鬆地將其嵌入到 Web Forms 中實現 HTML 內容的線上編輯,在新聞發布、部落格寫作、論壇社區等多種 Web 系統。http://files.cnblogs.com/soman/FreetextBox.zip(點擊下載控制項) 建立一個ASP項目 位置要選擇 HTTPOK後 在工具列中
Time of Update: 2018-12-06
以下是引用片段: using System; using System.Collections.Generic; using System.Text; using System.Data; using System.Data.SqlClient; namespace OTC.Utility ...{ public sealed class JSONHelper ...{ /**//// /// 擷取JSON字串 /// /// 值 ///
Time of Update: 2018-12-06
using System;using System.Data;using System.Configuration;using System.Collections;using System.Web;using System.Web.Security;using System.Web.UI;using System.Web.UI.WebControls;using System.Web.UI.WebControls.WebParts;using
Time of Update: 2018-12-06
用戶端與伺服器端的非同步互動,相信大家多用jQuery提供的ajax方法實現的。下面是摘抄的jQuery API中的Ajax函數使用說明: 上面有一個data參數允許你傳遞發送到伺服器的資料,,jQuery會根據post或者get協議對參數data進行序列化。 如果提交的資料使用複雜的json資料,例如: {UserID:1,UserInfo:{ Name:"Lily",
Time of Update: 2018-12-06
有哪些Action
Time of Update: 2018-12-06
[翻譯]ASP.NET MVC 教程 - 傳遞資料到視圖主版頁面 2009-11-20 11:05 A.M.
Time of Update: 2018-12-06
用Page.ClientScript.RegisterClientScriptBlock 和Page.ClientScript.RegisterStartupScript:區別: 1.使用Page.ClientScript.RegisterClientScriptBlockc#代碼 Code highlighting produced by Actipro CodeHighlighter (freeware)http://www.CodeHighlighter.com/--> 1 <%@
Time of Update: 2018-12-06
好的解決方案 在這節,我們會測試一個替代的並且更好的解決方案來實現從控制器行為傳遞資料到視圖主版頁面。與在每一個控制器行為添加電影分類相反,我們只添加電影分類到視圖資料一次。所有的被視圖主版頁面使用的視圖資料都添加到一個應用控制器。 ApplicationController類包含在清單4.清單4 - Controllers\ApplicationController.csusing System.Linq;using System.Web.Mvc;using MvcApplication1