C# - Store & Return Settings For A Webpage?

Sep 13, 2010

So I am using C# ASP.NET 3.5 and I would like to add a feature to my site to turn on and off a sort of debug mode for testing purposes.

Is there a best way to have a file or class that stores or returns simply if myDebug is on or off. It has to be accessed fast since it will be used a lot on multiple pages and it should be easy to set using the website itself.

My first thought is just a class with get/set which is stored on every page... perhaps the master page?

View 2 Replies


Similar Messages:

Store Config Settings For A .NET DLL (not EXE Or Web)?

Jan 19, 2011

I have a .NET 4 class library project, which is used by multiple web projects. In this class library I need to get a DB connection string and it needs to be the same for all the web projects. Currently I've got it as a setting in each web.config file, but this is not ideal. Is there any way I can have that configuration stored with the DLL, but still allow it to be modified at runtime (ie. hardcoding the connection string is out)?

App.config seems to be generally ignored for a DLL, even though it does get renamed to assemblyname.dll.config and copied to the bin directory for the web. I tried making it an "application setting" (ie. using the auto-generated class derived from System.Configuration.ApplicationSettingsBase) and this appeared to work, but changing the value in the DLL .config file at runtime had no effect, so I suspect it's really just using the hardcoded default value of the setting.

View 3 Replies

Use XML To Store Configuration Settings In C#.Net Application?

Mar 11, 2011

My question relates to the performance implications of reading application configuration data from an XML file.I am building an application that lists information from a database and needs to know how to display the lists, depending on the types of data returned.This is difficult to explain, but basically I would like to have an XML config file that lists the types and describes how to display them. This will allow me to change the display methods without re-compiling the application.

My question is really around performance. Given that my application will need to use this data many times during each page load...Should I be reading directly from the XML file and parse it each time I need it?
Or should I cache the XML object and parse it each time I need it?Or should I parse the XML once, generate some sort of object and cache that object?My guess is option 3, but I'm basically fishing for best practice around this.

View 1 Replies

C# - Best Way To Store Configuration Settings Outside Of Web.config?

Jun 6, 2010

I'm starting to consider creating a class library that I want to make generic so others can use it. While planning it out, I came to thinking about the various configuration settings that I would need. Since the idea is to make it open/shared, I wanted to make things as easy on the end user as possible. What's the best way to setup configuration settings without making use of web.config/app.config?

View 3 Replies

C# - Where To Store The Global Settings To Allow The Application To Access Them Frequently

Mar 7, 2011

I have some global settings in my application that is going to be handled by the administrator and I store them in the database.

Settings like: board on/off, max items/page on different UserControls, language, hide/show modules.

What technique should I follow to read the values in the database and display the page or the application according to it .. Of course I could do it the easy way and fetch the required settings for each page in the Page_Load event handler but I think that will be a lot of database connection!

View 1 Replies

Security :: Use Membership Store For User Settings With Windows Authentication

Sep 1, 2010

I am evaluating ASP.NET Membership for an intranet Silverlight app. I want users to be automatically authenticated for my application with their windows logon. Thus I configured Windows Authentication. I would like to store user settings like email-address in using the SqlMembershipProvider and not AD. It seems that storing user settings using the SqlMembershipProvider is not supported with Windows Authentication. Is this really so (using .NET 4)?

If so: What is the rationale behind this? IMHO authentication, user settings and authorization are distinct aspects. User settings could easily be stored (identified by user name) using the SqlMembershipProvider with authentication and password management being supplied by Windows. What is the recommended solution for my scenario?

View 2 Replies

Web Forms :: Transmit Settings (variables' Values) In Url To Webpage?

Sep 23, 2010

From this webpage: http://abg.asso.fr/Page/Offer/SearchOffer.aspx , I want to have a link which shows me directly 50 job openings in a specific (Engineering) domain (the default is 5 jobs in all categories).I know that in ASP, I can transmit a variable value by

[Code]....

But it is not working.

View 4 Replies

Access :: Sum Rows And Return To Webpage?

Nov 30, 2010

I have an Access db on webserver. In my ASP webpage I need to return the sum of rows which match criteria.

I am not sure where the sum needs to happen. I tried sum in the sql statement, but got an error when it tried to put it in asp page.this is what I have

strSQL = "Select * from tblApplicantCreditors where ApplicantID = '" & strApplicantID & "'"

View 6 Replies

Web Forms :: Return Integer Result From Store Procedure

Feb 21, 2012

I want to return integer result from storeprocedure.I have used dataset to return values.My store procedure which i have wrotewhich return three result 0,1,2I want to get this result..how to get that result.

View 1 Replies

Web Forms :: Value Return From Master Page To Webpage?

Jun 17, 2010

i am using master page and one webpage. first home page fired after home page masterpage fired.in the master page one value to be used in Home page how to get value from masterpage to homepage.

View 4 Replies

How To Get Webpage To Return Value To Desktop Application Caller

Sep 18, 2010

I need to make an autoupdater for my application. This has been done, and it is working perfectly. However, my application currently downloads version.txt, and reads it to work out whether it needs to download the new application. This is hideous, and slow, and was only supposed to be very temporary. It is also very annoying that we have to update this file every time we release a new version.

My boss wants me to create a webpage that reads the version data from the uploaded .exe, and then returns that to the Desktop application. Therefore, I would be able to call www.example.com/version.aspx, and it would return the version number, such as 1.1. I could then compare to the current version (don't worry, it is generated on the fly, and not hard coded) and then I could download the application if required.

Here comes my question. How would I go about this? I have heard of CGI scripts, and asp.net. Which one of these has the power to solve my problem. If you could just tell me that, then I will be all sorted, as I could read up on it, learn, and broaden my knowledge.

If this is not possible, or not easily possible, is there any way of reading the file version of a remote .exe, without downloading it. This would also be preferable in many ways.

P.S. I did try to explain this to my boss, and suggested that maybe he could either do it, but he is not very good at web applications, and refused, saying that it would broaden my education in this matter.

EDIT: Somehow forgot to add: I normally program in C#, although this application should be so small, that it would not really matter. Also, C# code would be ideal, if there is a way to check the version of a file on a remote server.

View 1 Replies

Databases :: Oracle Store Procedure Does Not Return Any Thing In The Out Parameter

Oct 20, 2010

I am goig to execute an oracle store procedure using C# through through ODP.NET. The store procedure executes succsfully but it does not return any value in the out parameter.

When I execute the same store procedure with the same input parameteres from within SQL*Plus. It does return values.

This is to be clearify here that in the oracle store procedure the data type for the out parameter is number and in the c# the variavle that will hold its value is Integer. I also tried using Long on the C# side but it is still not working. After the successfull execution of the store procedure the C# variable contains nulll value.

View 3 Replies

Web Forms :: Store And Retrieve Images From Database To Webpage?

Nov 23, 2012

i have a web page in asp.net.vb code and sql database.

the persons number is called PNUMB and i have stored all photos of persons in a folder with the persons number (PNUMB) as their file name. when i search for a PNUMB i want to display the photo of the persons whose dtata is displayed. how i sit possible

View 1 Replies

Web Forms :: Store Selected Index Of Listbox In Hidden Field And Then Return To That Value On Postback?

Jan 4, 2011

I must be doing something wrong, but this makes sense to me. I have a Listbox loaded with tons of items from a datasource. A user clicks one of these items it grabs the selectedindex (an integer) and stores it in a HiddenField (works fine).

Now when the page does a complete a refresh (after postback) I want the ListBox to go back to that selectedindex that is in the HiddenField. Problem is, it seems that after postback the HiddenField is empty? Then I thought about storing the value in an Integer variable in code, but that is simply coming up as a zero at all times.

Question 1: What is the best/simplest way to do this?

Question 2: How?

I am currently grabbing it on selectedindex change

[Code]....

View 2 Replies

Forms Data Controls :: Return Single Field To A Different Webpage Using Hyperlink?

Aug 6, 2010

I want to return single field to a different webpage using hyperlink.

View 12 Replies

Visual Studio :: Group Profiles Settings - Users In The Group Update The Same Settings?

Jan 19, 2010

We have many different clients, and each client can have multiple user accounts.Right now, we have user settings set up on the ASP project, and a WinForms application can see these settings, depending on which user logs into the winforms application. They are specific to the user. I want to make them specific to the client, so users can be in "groups" by their client, and all users in the group would see/update the same settings.

View 1 Replies

How To Store Store Procedure Results In A Dataset When There Are 3 Sql Datasets Returned

Mar 11, 2011

My SQL stored procedure returns 3 different datasets as follows:

team_id name
1 Team1
2 Team2
...and more

location_id name
1 Dallas
2 New York
...and more

branch_id name
1 Austin
2 New Jersey
...and more

How do I put this data into one Dataset so that I can loop through the data and manipulate it?

View 1 Replies

Architecture :: Best Way To Implement Online Ordering For A Store Store Already Built?

Mar 19, 2010

hey folks I got a general question that maybe some of you can just weigh in. I developed an online store for a client and people place orders online for a food ordering place however I am trying to find the best way to have the orders show up for them at the store. Currently I am sending an email and an autoprint software prints it out which works most of the time but not good enough sometimes it doesn't print. Anyone had similar issues or have other alternative solutions you may have heard off? Like I said the site sends an email to the customer and the store's email account.

View 7 Replies

SQL Server :: DAL Doesn't Return The Return Value Of Stored Procedure?

Nov 8, 2010

I have an update function in my data layer which is defined as:

public int UpdateRBTable(parameters ...) This calls a SQL Server Stored Procedure to perform an update function on the database.

The process does its job for updating the table. However, the stored procedure has a return value (which indicates how many rows were updated), but this return value is not returned to the application. The application always shows that a zero was returned from the stored procedure.

View 3 Replies

Can WebMethod Return An XmlDocument As Return Type

Jan 22, 2010

Can my WebMethod return an XmlDocument as return type?

When I try to consume the web service I'm still not getting XML. It appears as though a reference to the method is being returned rather than say a string containing XML.

<WebMethod()> _
Public Function CustomerSearch(ByVal lastName As String, ByVal firstName As String, ByVal companyName As String, ByVal city As String, ByVal state As String, ByVal email As String) As XmlDocument
' Create XML doc
Dim doc As XmlDocument = New XmlDocument()
' some more code
Return doc
End Function

View 4 Replies

MVC :: How To Return 401 Error From A Method Return ActionResult

Sep 28, 2010

how can i return 401 error from a method return ActionResult?

View 1 Replies

Assign A Value To the Methods Return Var before Return The Final Value?

Dec 2, 2010

How can I assign a value to the methods return var BEFORE I return the final value?

Example:

public string Example()

{
[here I want to assign a value to the return var and continue this block until the end] = "TempStr"; [code].....

View 2 Replies

Web Forms :: Whenever Click On Any Button On Webpage, The Request Goes Through, But Nothing Show Up On The Webpage?

Dec 17, 2010

I am working on a financial portal and I am having a problem..I don;t know what to call it so i mentioned it as an 'unknown to me' problem..I have a webpage..whenever I click on any button on my webpage, the request goes through..but nothing show up on the webpage..then If I click on another link and then again come back to previous link,then only I see the results of button_click..

e.g.

I have a currency conversion and investment form..so after filling up the form in following way and if I click on "INVEST" then nothing shows up..

so now if i click on any other link and go back to 'buy currency' link I see the result as 'investment successful'

View 3 Replies

How To Get C# Return Dropdown List To Return Value As Int

Jun 8, 2010

How to get asp.net return drop down list to return value as int

I want to pass the value to a stored procedure as an integer. But the default appears to be as a string which is not what the store procedure is expecting.

Is there a good way to return the list values as ints?

I suspect I can you set the value on the change selection event, is there another way?

View 2 Replies

Php - How To Embed The Result Of A Webpage Into Another Webpage On Another Website

Mar 23, 2010

I would like to allow users to call my ruby on rails app as a service which returns a 'div' with html content in it, and embed that div into their app (which will not be a rails application).

For example, assume someone has their own php website that has a header/footer template that gets rendered, and a content area of the page that they need to fill based on some html I generate in my rails app. I would like to allow them, from php, to call to my website, get the 'div' I generate, and embed that as html in their php page.

What I'm trying to do is host a service on my site that returns some html content, but actually show that content as part of another site, so that the end user only sees the other site and never really knows about mine.

Also, I can use javascript on the client to do this if that is the only way, but I would prefer the php app to handle this at the server if possible so the client gets the html embedded from the original server and it looks like it all was generated by the php script that generated the entire page. I also want to avoid using an iframe.

View 3 Replies







Copyrights 2005-15 www.BigResource.com, All rights reserved