Posts By: jiangws2002
Working with WebParts Page, WebPart Zones & WebParts
リンク: Working with WebParts Page, WebPart Zones & WebParts – 123aspx.com ASP.NET Resource Directory.
Source Code’s Included
リンク: Building WebParts in ASP .Net 2.0.
Source Code’s included
リンク: Anonymous Personalization Trick in Web Parts – The Code Project …
ASP.NET Development Center: Introducing the ASP.NET 2.0 Web Parts Framework
サンプル付き、わかりやすく説明。
リンク: ASP.NET Development Center: Introducing the ASP.NET 2.0 Web Parts Framework.…
ASP.NET程序中常用代码汇总(五)
リンク: ASP.NET程序中常用代码汇总(五) – dotnet.csdn.net 团队blog (测试).
…41.判断是否为数字 /**////
/// 名称:IsNumberic /// 功能:判断输入的是否是数字 /// 参数:string oText:源文本 /// 返回值: bool true:是 false:否 ///
public bool IsNumberic(string oText) { try { int var1=Convert.ToInt32 (oText); return true;
ASP.NET程序中常用代码汇总(四)
リンク: ASP.NET程序中常用代码汇总(四) – dotnet.csdn.net 团队blog (测试).
31. 当文件在不同目录下,需要获取数据库连接字符串(如果连接字符串放在Web.config,然后在Global.asax中初始化)
在Application_Start中添加以下代码:
AppSettings[“ConnStr“].ToString();
32.变量.ToString()
字符型转换 转为字符串
12345.ToString(“C“); //生成 ¥12,345.00
12345.ToString(“e“); //生成 1.234500e+004
12345.ToString(“f4“); //生成 12345.0000
12345.ToString(“x“); //生成 3039 (16进制)
12345.ToString(“p“); //生成 1,234,500.00%
33.变量.Substring(参数1,参数2);
截取字串的一部分,参数1为左起始位数,参数2为截取几位。 如:string s1 = str.Substring(0,2);
ASP.NET程序中常用代码汇总(三)
リンク: ASP.NET程序中常用代码汇总(三) – dotnet.csdn.net 团队blog (测试).
31. 当文件在不同目录下,需要获取数据库连接字符串(如果连接字符串放在Web.config,然后在Global.asax中初始化)
在Application_Start中添加以下代码:
AppSettings[“ConnStr“].ToString();
32.变量.ToString()
字符型转换 转为字符串
12345.ToString(“C“); //生成 ¥12,345.00
12345.ToString(“e“); //生成 1.234500e+004
12345.ToString(“f4“); //生成 12345.0000
12345.ToString(“x“); //生成 3039 (16进制)
12345.ToString(“p“); //生成 1,234,500.00%
33.变量.Substring(参数1,参数2);
截取字串的一部分,参数1为左起始位数,参数2为截取几位。 如:string s1 = str.Substring(0,2);
ASP.NET程序中常用代码汇总(二)
11.自定义异常处理
using System;
using System.Diagnostics;
namespace MyAppException
{
/**//// <summary>
/// 从系统异常类ApplicationException继承的应用程序异常处理类。
/// 自动将异常内容记录到Windows NT/2000的应用程序日志
/// </summary>
public class AppException:System.ApplicationException
{
public AppException()
{
if (ApplicationConfiguration.EventLogEnabled)LogEvent(“出现一个未知错误。“);
}
public AppException(string message)
{
LogEvent(message);
}
public AppException(string message,Exception innerException)
{
LogEvent(message);
if
ASP.NET程序中常用代码汇总(一)
リンク: ASP.NET程序中常用代码汇总(一) – dotnet.csdn.net 团队blog (测试).
1. 打开新的窗口并传送参数:
response.write(“<script>window.open(’*.aspx?id=“+this.DropDownList1.SelectIndex+“&id1=“++“’)</script>“)
//接收参数:
string a = Request.QueryString(“id“);
string b = Request.QueryString(“id1“);
2.为按钮添加对话框
button.attributes.add(“onclick“,“if(confirm(’are you sure?’)){return true;}else{return false;}“)
3.删除表格选定记录
string deleteCmd = “DELETE from Employee
ASP.NET Web Parts Pages
リンク: ASP.NET Web Parts Pages.
リンク: WebParts Communication: How WebParts on a page communicate with each other.…
Enterprise .NET Community: Creating a Custom ASP.NET Profile Provider
リンク: Enterprise .NET Community: Creating a Custom ASP.NET Profile Provider.
ASP.NET 2.0 is a compelling platform for most Web sites. The inclusion of many of the basic facilities that most Web sites will need like the ability to have …