·您现在的位置: 云翼网络 >> 文章中心 >> 网站建设 >> 网站建设开发 >> ASP网站建设 >> 从ASP转到ASP.NET过程中常见问题收集

从ASP转到ASP.NET过程中常见问题收集

作者:佚名      ASP网站建设编辑:admin      更新时间:2022-07-23

做了2年多asp。09打算转向.NET先将学习过程中遇到的问题和解决的办法写出来提醒自己和后来者少走弯路

   1、Q:请问在asp.net中路径中   "~"   波浪号表示什么含义?
   A:是你的虚拟目录的根 .
   比如你的虚拟目录是 http://localhost/web  那么   ~/aaa/index.html   就  是  http://localhost/web/aaa/index.html 
  参考:http://topic.csdn.net/t/20060309/13/4603073.html
  关键字:asp.net 路径 波浪
  引擎:Google
2 使用c#给服务器控件的客户端事件绑定JS处理程序的方法?

 wctl.Attributes.Add("onfocus", string.Format("this.className = '{0}';", className));

编程html后的代码为;

onfocus="this.className='className'"

18:11 2009-3-1:使用C#代码读取web.config文件中的<connectionStrings>配置节

demo:

 <connectionStrings>
  <add name="test_dbConnectionString" connectionString="Data Source=PROGRAME-8P1PK1;Initial Catalog=test_db;User ID=sa;PassWord=000000"
   providerName="System.Data.SqlClient" />
 </connectionStrings>

1 引用using System.Web.Configuration命名空间

2 string connectionString =ConfigurationManager.ConnectionStrings["dbConnectionString"].ConnectionString;
参考:http://www.1-100.org/AspNet/25018.htm

关键字:connectionStrings asp.net