收集ASP转ASP.NET过程典型问题_[Asp.Net教程]
1、在asp.net中路径中 "~" 波浪号表示什么含义?
A:是你的虚拟目录的根 .
比如你的虚拟目录是 http://localhost/web 那么 ~/aaa/index.html 就 是 http://localhost/web/aaa/index.html
2 使用c#给服务器控件的客户端事件绑定JS处理程序的方法?
wctl.Attributes.Add("onfocus", string.Format("this.className = ’{0}’;", className));
编程html后的代码为;
onfocus="this.className=’className’"
使用C#代码读取web.config文件中的
配置节
demo:
providerName="System.Data.SqlClient" />
1 引用using System.Web.Configuration命名空间
2 string connectionString =ConfigurationManager.ConnectionStrings["dbConnectionString"].ConnectionString;