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