I have been working as an asp for more than 2 years. 09 If I plan to switch to .NET, I will first write down the problems encountered during the learning process and the solutions to remind myself and those who come after me to avoid detours.
1. Q: What does the "~" tilde in the path in asp.net mean?
A: It is the root of your virtual directory.
For example, if your virtual directory is http://localhost/web, then ~/aaa/index.html is http://localhost/web/aaa/index.html
Reference: http://topic.csdn.net/t/20060309/13/4603073.html
Keywords: asp.net path wave
Engine: Google
2 How to use c# to bind JS handlers to client events of server controls?
wctl.Attributes.Add("onfocus", string.Format("this.className = '{0}';", className));
The code after programming html is;
onfocus="this.className='className'"
18:11 2009-3-1: Use C# code to read the <connectionStrings> configuration section in the web.config file
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 Reference using System.Web.Configuration namespace
2 string connectionString =ConfigurationManager.ConnectionStrings["dbConnectionString"].ConnectionString;
Reference: http://www.1-100.org/AspNet/25018.htm
Keywords: connectionStrings asp.net