473,503 Members | 1,733 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

How to use a variable in web.config

ad
I have a Asp.Net project, it use JScript to program the client's script
I declare a variable in web.config like:
<add key="CompanyName" value="Big Salse company" />

How can I use the CompanyName in my jscript?

Nov 18 '05 #1
2 2252
You will need to write out the jscript from your code behind page.
You could use a client side call to a webservice from jscript but if all you
need is to pick up a name then write out your variable from the code behind
when the page loads.

"ad" <ad@wfes.tcc.edu.tw> wrote in message
news:uo**************@TK2MSFTNGP12.phx.gbl...
I have a Asp.Net project, it use JScript to program the client's script
I declare a variable in web.config like:
<add key="CompanyName" value="Big Salse company" />

How can I use the CompanyName in my jscript?

Nov 18 '05 #2
Hi,

In your javascript client block u can add this:
var
compname='<%=System.Configuration.ConfigurationSet tings.AppSettings["CompanyName"] %>'
//alert(compname);

---
Bharat Biyani (bs*@orcim.com)
http://www.orcim.com

"ad" wrote:
I have a Asp.Net project, it use JScript to program the client's script
I declare a variable in web.config like:
<add key="CompanyName" value="Big Salse company" />

How can I use the CompanyName in my jscript?

Nov 18 '05 #3

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

7
7162
by: Billy Jacobs | last post by:
I am having a problem with my session variable being set to Null for no apparent reason. I am declaring it like the following when the user logs in. dim objUserInfo as new clsUserInfo 'Set...
11
4165
by: Paul D.Smith | last post by:
Can Python create a variable "on-the-fly". For example I would like something like... make_variable('OSCAR', 'the grouch'); print OSCAR; ....to output... the grouch
17
4431
by: Mike L | last post by:
This is for a Win form. Currently I have several connection strings that are identical through out my application. Is a global variable the best choice for this situation? If so, what is the...
7
2150
by: Greg Collins [MVP] | last post by:
Hi, I couldn't find what I was looking for by searching the newsgroup, but perhaps these have already been discussed somewhere. This is a bit long with a lot of interrelated questions. What I've...
41
10632
by: Miguel Dias Moura | last post by:
Hello, I am working on an ASP.NET / VB page and I created a variable "query": Sub Page_Load(sender As Object, e As System.EventArgs) Dim query as String = String.Empty ... query =...
2
2328
by: simon | last post by:
hello, what i'm looking to do is store the path of the app on a the server for reuse in the site. my thoughts so far are... -make a key in the web.config file -retrieve the value in globals.asax...
12
7907
by: Chris Allen | last post by:
Hello fellow pythoneers. I'm stumped on something, and I was hoping maybe someone in here would have an elegant solution to my problem. This is the first time I've played around with packages, so...
0
7203
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
7087
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
7281
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
5579
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
1
5014
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...
0
4675
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and...
0
3156
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
0
1514
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated ...
0
383
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.