Click here to Skip to main content
16,006,348 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
In Web.config I can call on my connection string "connstring" in my aspx file by using this statement:

"<%$ ConnectionStrings:connstring %>"

I have seen other similar things used in aspx files like:

"<%# "name" %>"

I was wondering if you could also save "strings" in the hierarchy of Web.config also?
Posted
Updated 9-Feb-14 1:38am
v2
Comments
teledexterus 9-Feb-14 7:43am    
Just a simple example of what code you need to write to get a string out of "<# "name" %>"

In the appsettings, of course ;)
Take a look there : http://odetocode.com/articles/345.aspx[^]
 
Share this answer
 
Comments
teledexterus 9-Feb-14 7:49am    
What is the xml code behind "<%# "name" %>"
Artefakt94 9-Feb-14 7:51am    
string One_AppSetting = ConfigurationManager.AppSettings["One_AppSetting"];
teledexterus 9-Feb-14 7:57am    
So in "<"configuration">""<"appsettings">""<"/appsettings">" what do you put to get out a string in aspx?
Artefakt94 9-Feb-14 8:00am    
I didn't understand ...
teledexterus 9-Feb-14 8:07am    
In Default.aspx there exists a "<%# "name" %>" how in web.Config xml code do you identify the string variable "name" to store a string?

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900