当前位置:多学网学习教育电脑学习编程入门NET教程从ASP转到ASP.NET过程中常见问题收集

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

[08-23 22:10:31]   来源:http://www.duoxue8.com  NET教程   阅读:767
从ASP转到ASP.NET过程中常见问题收集,标签:asp.net教程,net教程,http://www.duoxue8.com

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

1、Q:请问在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'"

 

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;


 




从ASP转到ASP.NET过程中常见问题收集 结束。
Tag:NET教程asp.net教程,net教程电脑学习 - 编程入门 - NET教程
从ASP转到ASP.NET过程中常见问题收集相关文章