Use web.config with web forms?

 Hi All,

 I'm doing some unit testing of a web application, and would like to use settings from a web.config file.  Is this possible?

 Thanks much,

- Mark

0
dogmotor
9/15/2008 11:51:32 AM
asp.net.getting-started 91979 articles. 3 followers. Follow

4 Replies
888 Views

Similar Articles

[PageSpeed] 50

I'd suggest keeping your Unit Tests in a seperate project and using it's own .config file. It will be a little repetition but it will help to keep things seperated for perf and reusability without bloating your production app.


0
Curt_C
9/15/2008 12:23:23 PM

I agree with Curt. It is better to seperate options for testing and release version. This will decrease the job to be done once the unit testing process is finished.


Haissam Abdul Malak
MCAD.NET
| Blog |
0
Haissam
9/15/2008 1:07:51 PM

 Thanks!  Another questions - there is a library that's part of the web application.  This library uses Session variables for various data functions.  Is there any way to simulate this in a testing environment with web forms?

 I apologize if this should be a new thread..

 - Mark

0
dogmotor
9/15/2008 2:45:46 PM

You'll have to manually instantiate a Session object and HTTPContext most likely.


0
Curt_C
9/15/2008 2:51:11 PM
Reply:

Similar Artilces:

Why we use Web.Config File for connection string wether we can use class Library for get connection for whole web Application
 Why we use Web.Config File for connection string wether we can use class Library for get connection for whole web Application  please help me? Friend, Web.config has its own advantages. 1) Web.Config is used to store the important information like connections strings etc...so that it can be modified even after the code has been    deployed to the server without compiling the entire application again. 2) Since it is a XML file, there is no need of building the project of you are going to change the connection strings.   If you go for the class files,...

web web web
Name: bahadir Email: sensiz_olmuyor_t1_at_hotmail.com Product: Firefox 2 Beta 2 Summary: web web web Comments: web sayfası yapmak Browser Details: Mozilla/5.0 (Windows; U; Windows NT 5.1; tr; rv:1.8.1b2) Gecko/20060821 Firefox/2.0b2 ...

Using multiple web.configs with different web apps in the same web folder.
How do I tell a web application to use a specific web.config file instead of referencing the root web apps web.config file? Example: In IIS i have this setup:My Server  Web Sites     Default Web Site (this has web.config with a reference to a HTTP Handler)     My Http Handler           My Sub Web             < --- This sub web is looking for the http handler in this web hope that makes sense.   shawn use location elem...

C#.NET WEB APPLICATION
hei guys, i need help on my application, i'm using C#.NET as front-ed and SQL as back-end, aside from a datagrid, i want to display my data using textboxes and not a datagrid, i can do it using Visual Basic 6 but since i'm a newbee at C#.NET i don't know how to do it, specially the codes, can anyone help me with it? thank you in advance! If you are doing windows development, i would suggest using 'DataForm wizard' (Use Solution Explorer-->Rightclick project-->Add new Item-->New DataForm). It will guide you through steps. If you are doing web apps. Use quickstart to learn them. h...

How to get HTML Source of web page opened by web browser using vb.net
hello friends,         i have opened an web browser in vb.net using the below code Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click Dim nullObject As System.Object = 0 Dim str As String = "" Dim nullObjStr As System.Object = str Windows.Forms.Cursor.Current = Cursors.WaitCursor Dim i As Int16 For i = 1 To 2 AxWebBrowser1.Navigate("http://www.google.co.in/search?hl=en&q=test&meta=", True) AxWebBrowser1.Document. Next Windows.Forms.Cursor.Current = Cursors.Default End Sub  ...

getting start with vb.net and crystal repots(web form)
I use Crystal Report9 in Visual Studio.NET 2003..... Example at Northwind database I want a application that.....a form include a combobox that contain CustomerID.....If I choose one CustomerID and click OK button....a Report will display information about this Customer......I think that must use Paramater.....how to do that ???? (How do I start to coding --please step by step or sample) please help me !!! Thank you so much!!! very good I have Dropdownlist when I choose the 'month'--> the all data of this field will show I use this Private Sub ddlMonth_Sel...

How to get the HREF value of the Anchor tag in a web page using the web browser control in vb.net
Hi Friends,               i have a webserver control in my application.i load the web browser control on a button click using the below code Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click                AxWebBrowser1.Navigate("http://www.rateitall.com/i-322335-.aspx", False) End sub once the page is loaded in the browser i want the <a> HREF value in that page.For example if that page has ...

Changing URL in web.config for web service
I added a web reference to asmx file. In web.config - it adds - undefinedadd key="CoreService.CoreServices" value="http://test/CoreServices.asmx I then change it to <add key="CoreService.CoreServices" value="http://test2/CoreServices.asmx"/> But CoreService.CoreServices still looks for http://test/CoreServices.asmx.  What else do i have to change? I think CoreService.CoreServices are hard coded into the source code.  Girijeshhttp://www.girijesh.in/ I think CoreService.CoreServices are hard coded into the source code.  Girijeshhttp://www.girijesh.in/ So no ...

can someone one give me difference between web form and mobile web form and which or where or when i'm using the forms?
thanks Marc Hi Marc, Based on my understanding, you want to know the differences between the ASP.NET web application and ASP.NET mobile web application. If I have misunderstood you, please feel free to let me know. The ASP.NET forms are used to develop the ASP.NET pages for desktop browsers and The ASP.NET mobile forms are used to develop the ASP.NET pages for mobile device browsers. When we create the ASP.NET mobile web forms pages, we can use nearly all the features of ASP.NET. But there are a couple of compatibility issues: Error Handling and Reporting. Tracing. Using Redi...

How to get new web app to use .NET 2.0 on Win2K server using .NET 1.1 as default framework?
I have .net framework1.1 and 2.0 on our server running win2K. i have existing applications that uses asp.net 1.1, i also have a new app that use ASP.net 2.0.  how can i set my new .NET 2.0 app to point to asp.net 2.0 without messing up my existing .NET 1.1 apps? To specify the ASP .Net version fro a web application, do the followingIn IIS Manager select the web application -> Properties -> ASP.Net TabSelect  ASP.Net version you want to use for the applicationRegards,PrashantDont forget to click "Mark as Answer" on the post that helped you. But I am running Win2K...

running 2 web.configs in the same website 1 in /web.config and one in /swf/web.config
Im having issues doing this. and when i remove the authentication from the swf/web.config it still doesnt seem to be applying to the child website at all. Whats the proper way to set a child website? Thanks!!  The lower most web.config overrides all previous settings. So if you remove the section from the /swf/web.config whatever settings you have in the web.config in the next higher level will have an effect on the content of the child folder.So instead of removing a section, try giving appropriate settings in the /swf/web.config....

Using Multiple Web.Config for mutliple web apps sharing a web site as virtual directories
I have a web site on IIS 6.0 Windows 2003 Server. I have created several virtual directories to point to other .net projects that I wish to use in the website. The main site, which was made in C#, has a line in the web.config that allows the use of VB by defining a speical code directory. Now, when I attempt to use the other applications they throw this error. It looks like they are all sharing the main web.configParser Error Message: The code subdirectory '/Forum/App_Code/VBCode/' does not exist.Source Error: Line 62: <!-- for SIP asp.net forum -->Line 63: <codeSubDirect...

Need Windows Form to Retrieve Information From Web Form
I have a cash and carry web site that customers can order products, the next day come in to the company to pay and pickup. I would like to create a windows application for the company to do two things: 1. download all the orders from the day before 2. upload price changes, product changes, category changes I've search the internet and forums and the only thing I can find that I think would actually link these two together would be a web service. Can you please tell me if I am heading in the right direction or if there is another method to link the two applications, if there are any pitf...

Web Forms Security via web.config?
In classic ASP, if you wanted to restrict someone from a certain area on the website (say, a "client area"), you would activate a session flag once their login creditials had been verified, and challenge each visiter at each protected page for that session flag. I had heard that with ASP.NET, this has been greatly simplified through the web.config file, but wasn't offered too much support on the issue.  Does anyone know how it can be implemented simply and quickly via the web.config file?  Are there any simple descriptions online somewhere?  Ideally, I'd like to authorize the...

Web resources about - Use web.config with web forms? - asp.net.getting-started

Proxy auto-config - Wikipedia, the free encyclopedia
Computer operating systems (e.g., Microsoft Windows , Mac OS X , Linux ) require a number of settings to communicate over the Internet . These ...

Platform Updates: New Industry Pages, Refreshed Services Status Page, and New Parse Config Dashboard
Platform Updates: New Industry Pages, Refreshed Services Status Page, and New Parse Config Dashboard

App Config for Android - YouTube
Free version: https://play.google.com/store/apps/details?id=fi.aarosoft.appconfig.free Full version: https://play.google.com/store/apps/deta ...

HP unveils cloud config manager
HP this week unveiled a network virtualization system for large enterprise and cloud providers designed to simplify network configuration.

China configs 'firewall' against official meddling in judicial cases
China configs 'firewall' against official meddling in judicial cases

Group criticizes Apple’s removal of IPv6 in Airport config tool
Back in January of this year Apple released AirPort Utility 6.0 , an updated version of the configuration tool for setting up home networks and ...

System Software: Configs for Mac 128K, XL, 512, & 512KE (7/94)
Macintosh 128K Currently ships with: Product no longer available. Supports: System 2.0 and Finder 4.1. Recommended: System 2.0 and Finder 4.1. ...

Free 32GB Apple TV and $60-$111 discounts on iMac 4Ks & iMac 5Ks, plus $150 coupons on all custom configs ...
Whether you want a free Apple TV plus discounts, a free AppleCare extended protection plan plus discounts, or just the lowest prices anywhere ...

Dell releases updated XPS-13 Developer Edition in wide variety of configs
... is available immediately in North America and Europe. According to Dell’s announcement blog post , there is a wide variety of possible configurations ...

Config error at Boston-area hosting company takes down Reddit, others
... hosting provider briefly knocked several large services and websites dependent on Amazon and AWS offline on Tuesday night, thanks to a configuration ...

Resources last updated: 12/29/2015 8:17:44 PM