asp.net 截取字符串代碼
1,把代碼放在sqlhelper中。 復(fù)制代碼 代碼如下: #region 截取字符串 /// <summary> /// 截取字符串 /// </summary> /// <param name="str_value"></param> /// <param name="str_len"></param> /// <returns></return...
|
1,把代碼放在sqlhelper中。 復(fù)制代碼 代碼如下: #region 截取字符串 /// <summary> /// 截取字符串 /// </summary> /// <param name="str_value"></param> /// <param name="str_len"></param> /// <returns></return...
1、新建一個(gè)類,實(shí)現(xiàn)IHttpModule接口 代碼 復(fù)制代碼 代碼如下: public class SqlHttpModule : IHttpModule { public void Dispose() { } public void Init(HttpApplication context) { context.AcquireRequestState +=...
以前也學(xué)過(guò)一些這方面的知識(shí),好久都沒怎么用了,忘得也差不多,正好現(xiàn)在可以重新鞏固一遍,熟悉一下對(duì)XML文件的操作。 XML(Extensible Markup Language)即可擴(kuò)展標(biāo)記語(yǔ)言,它與HTML一樣,都是SGML(Standard Generalized Marku...
要想在ASP.NET項(xiàng)目中使用SQLite數(shù)據(jù)庫(kù),先需下載一個(gè)ADO.NET 2.0 SQLite Data Provider,下載地址為:http://sourceforge.net/project/showfiles.php?group_id=132486&package_id=145568,下載后安裝完畢后,該安裝程序自...
復(fù)制代碼 代碼如下:using System; using System.Data; using System.Data.SqlClient; using System.Configuration; using System.Collections; using System.Web; using System.Web.Security; using System.Web.UI;...
復(fù)制代碼 代碼如下: if (!IsPostBack) { //一級(jí)分類列表 this.DropDownList1.DataSource = dsbb.SelectSubjct1(); this.DropDownList1.DataTextField = "cName"; this.DropDownList1.DataValueField = "Ccode"; this...
效果圖: html代碼復(fù)制代碼 代碼如下:<table align="center" bgcolor="#c0de98" border="0" cellpadding="0" cellspacing="1" width="99%"> <tr> <th colspan="2"> GridView演示</th> </t...
在html頁(yè)中,定義了TextBox控件, 復(fù)制代碼 代碼如下: <td align="center" style="width: 183px; height: 25px"> 緯度:<asp:TextBox ID="TextBox_l" runat="server" Width="76px"></asp:TextBox> 經(jīng)度:<asp:TextBox ID...
復(fù)制代碼 代碼如下: #region 方法一: DataTable tblDatas = new DataTable("Datas");
DataColumn dc = null; dc = tblDatas.Columns.Add("ID", Type.GetType("System.Int32")); dc.AutoIncrement = true;//自動(dòng)增...
比如每天凌晨七點(diǎn)的時(shí)候email發(fā)送一次報(bào)表。 這里首先想到的就是利用 Global.asax 文件來(lái)實(shí)現(xiàn), 以下Global文件的內(nèi)容。 復(fù)制代碼 代碼如下: <%@ Application Language="C#" %> <%@ Import Namespace="System.Threadin...
復(fù)制代碼 代碼如下:public string OutputByLine(string strContent)//通過(guò)設(shè)定的行數(shù)分頁(yè) { int pageSize = int.Parse(ConfigurationManager.AppSettings["pageSize"]);//每頁(yè)顯示行數(shù)從CONFIG文件中取出 string lin...
查了國(guó)內(nèi)幾個(gè)中文資料都沒解決,最后是在一個(gè)英文博客上找到一個(gè)可以用的辦法。他的解決代碼是:
代碼 復(fù)制代碼 代碼如下: //存成gif.ashx <%@ WebHandler Language="C#" Class="Gif" %> using System.IO; using Syste...
--前臺(tái) 復(fù)制代碼 代碼如下: <%@ Page Language="C#" AutoEventWireup="true" CodeFile="Successed.aspx.cs" Inherits="Biz_Order_Successed" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"...
以后我會(huì)陸續(xù)的寫出這段時(shí)間中學(xué)習(xí)到的東西,與大家一起分享。這篇文章也算是工作中的一個(gè)筆記吧,希望給遇到同樣問(wèn)題的朋友,一點(diǎn)小小的幫助。 在 開發(fā)工作中,因?yàn)橐鲇玫紺heckBoxList在客戶端用js操作,無(wú)論js怎樣調(diào)試,就是...
性能方面
Repeater比DataList要好一些,如果不是很大數(shù)據(jù)量的話,這點(diǎn)差別是體現(xiàn)不來(lái)的。
易用性方面
Repeater與DataList后臺(tái)的數(shù)據(jù)綁定都很簡(jiǎn)單,DataSource=... DataBind()就OK了
但是DataList在對(duì)布局的操作上...
復(fù)制代碼 代碼如下:using System; using System.Data; using System.Configuration; using System.Web; using System.Web.Security; using System.Web.UI; using System.Web.UI.WebControls; using System.Web.UI.We...
服務(wù)器控件顯示圖片問(wèn)題不大,會(huì)自動(dòng)顯示相對(duì)位置,
非服務(wù)器控件有兩種方法解決:
1. Request.ApplicationPath + 圖片路徑(images/xxx.gif) : 數(shù)據(jù)庫(kù)里 圖片路徑以文件夾名開頭
2. ResolveClientUrl("(~/images/...
在web.config里設(shè)置如下: 復(fù)制代碼 代碼如下: <?xml version="1.0" encoding="utf-8" ?> <!--overred--> <configuration> <configSections> <section name="RewriterConfig"type="URLRewriter.Config.RewriterConfigS...
原本準(zhǔn)備在上一篇中直接修改的,無(wú)奈編輯功能太差,打開一堆html代碼,空格“ ”都看的人眼花繚亂,只好另開一篇。
升級(jí)說(shuō)明:添加了針對(duì)一個(gè)界面多個(gè)職能提示位置的設(shè)定,只需修改文本框onfocus="fnStartInterval(this,'D...
用戶控件代碼: 代碼WebControls 復(fù)制代碼 代碼如下: using System; using System.Collections.Generic; using System.Linq; using System.Web; using System.Web.UI; using System.Web.UI.WebControls; namespace xuy...
即:使用 Membership 類 + FormsAuthentication 一起使用以創(chuàng)建的用戶管理與認(rèn)證的系統(tǒng)。 當(dāng)然這兩部分都可以單獨(dú)使用,今天先著重后者,至于前者,我下一篇隨筆將會(huì)寫到。
ASP.NET 中提供了多種認(rèn)證方式,比如大名鼎鼎的Win...
今天在后臺(tái)動(dòng)態(tài)生成一個(gè)html控件,類似這樣HtmlTableCell cell = new HtmlTableCell(); 直接給cell.InnerHtml = "單元格html代碼";然后頁(yè)面顯示是可以的,當(dāng)使用cell.Controls.Add(new Control())時(shí)候頁(yè)面卻輸出為:"無(wú)法...
效果圖如下: 源代碼如下: 復(fù)制代碼 代碼如下:using System; using System.Data; using System.Configuration; using System.Collections; using System.Web; using System.Web.Security; using System.Web.UI; using...
一.保存圖片到XML文件 復(fù)制代碼 代碼如下: /// <summary> /// 保存圖片到XML文件 /// </summary> private void UploadImageToXml() { ///得到用戶要上傳的文件名 string strFilePathName = loFile.PostedFile.FileNam...
前臺(tái): 代碼 復(fù)制代碼 代碼如下: <%@ Page Language="C#" AutoEventWireup="true" CodeFile="GridViewSort.aspx.cs" Inherits="GridViewSort" %> <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "ht...