Configuration Files Vs Normal XML Files?
Dec 8, 2010
In my web site which is basically a monitor application I have to keep a configuration file which contains some web servers name, names of web sites hosted on each web server, url and port numbers etc.
Can anyone please explain me what are the benefits of treating this configuration file as custom configuration file of my web application and reading it using "ConfigurationSection" or "IConfigurationSectionHandler" rather than treating it as a normal xml file and reading it using 'XMLDocument' or 'XMLTextReader' or 'XLINQ' etc? This will save me from creating an entry in in the web.config file as well this custom configuration file.
View 2 Replies
Similar Messages:
Oct 13, 2010
I have an application that uses resource files to display items in multiple languages. My app uses quote a lot of javascript and the alerts need to display in the local language. To do this, I have created an http handler which will read the keys and values of the culture-specific resource file and write them to a JSON array which is then embedded in the page in a script tag, the messages can then be accesses using, for exmaple:
Message.Error (en-GB = "Error", fr-FR = "Erreur")
The messages http handler works great in development, however when I run the application on a test server, I get the error: Could not find any resources appropriate for the specified culture or the neutral culture. Make sure "Resources.Alerts.resources" was correctly embedded or linked into assembly "App_GlobalResources.b0n9j90e" at compile time, or that all the satellite assemblies required are loadable and fully signed. The code that I use to acccess the resource file is:
ResourceManager manager = Resources.Alerts.ResourceManager;
ResourceSet resourceSet= Resources.Alerts.ResourceManager.GetResourceSet(Thread.CurrentThread.CurrentCulture, true, true);
Where Resources.Alerts is the type that contains my multi-lingual definitions. The build action for the Alerts.resx file is set to "Embedded Resource". Any ideas why this works locally but not on my test server, am I missing something?
View 1 Replies
Jun 2, 2010
The majority of files in the Temporary ASP.NET File folder for a given application get deleted by ASP.NET following compilation -- .DLL and .PDB files amongst others remain.
Our compiler produces proprietary debug information files which are amongst those that get deleted.
Marking the files read-only prevents this but are there other options available?
View 5 Replies
May 24, 2010
How to create MSI Files or setup files programmatically using MSBuild in VS 2008
View 1 Replies
Apr 4, 2011
I am creating an application like youtube to store videos and I need some advice.Should I use SQL Server FileStream to store the video files or should I store them somewhere on the hard disk and record the path as a varchar(MAX) inside SQL Server?Which is recommended and why?Do you recommend something else apart from both these?
View 3 Replies
Nov 30, 2010
I am trying to hide the admin files from normal users, however I get the following error:
Error 11 Unrecognized configuration section siteMap.C:projectsFamilyPhotoAlbum_VS_2010web.config 137
Below is the web.config:
<?xml version="1.0"?>
<!--
Note: As an alternative to hand editing this file you can use the
web admin tool to configure settings for your application. Use
the Website->Asp.Net Configuration option in Visual Studio.
A full list of settings and comments can be found in
machine.config.comments usually located in
WindowsMicrosoft.NetFrameworkv2.xConfig
[Code]....
View 4 Replies
Feb 24, 2011
I manage a large asp.net site which has previously been converted from static html site to asp.net. For several reasons (mainly SEO) we decided not to rename all the files to .aspx back when we originally converted the site. This was very easy to do by simply adding the buildProvider and httpHandler to the web.config.
<buildProviders>
<add extension=".html" type="System.Web.Compilation.PageBuildProvider"/>
</buildProviders>
<httpHandlers>
<add path="*.html" verb="*" type="System.Web.UI.PageHandlerFactory"/>
</httpHandlers>
Now I am upgrading the site to use Asp.net WebPages with Razor cshtml files. I can rename all the files if necessary, and use url rewriting to make the urls stay the same, however it would be much easier if I could just configure the web.config to tell it to parse .html files as if they were .cshtml. I have searched around quite a bit, and could not find anything equivalent to the PageHandlerFactory for razor pages. It appears as though it is just an internal mechanism in the .net 4.0 ISAPI handler.
The site is currently running on Windows 2003 server and IIS 6. We will be upgrading to 2008/IIS 7.5 in the near future, but I'd prefer not to wait for that. Is there any way to get the .html files to be parsed by razor as if they were .cshtml files?
View 2 Replies
May 6, 2010
I basically want to do a reverse 'search in all files', so it returns files that don't contain "keyword".Does anyone know how to do this, or the regex used, etc?
View 1 Replies
Jul 1, 2010
I was following the tutorials from this two sites:
http://www.15seconds.com/issue/070104.htm
http://aspnet.4guysfromrolla.com/articles/020404-1.aspx
Following the first site, it had worked but when I´ve moved the pages and files to other folders and set the web.config file on this folder, now it won´t work at all!!!
The file is an *.swf object. I did put the asapi.dll to map the extension on the website root, I´ve put the
[Code]....
on the web.config new folder and on the web.config website´s root.
It won´t work!!! I can access the file directly!!! on the web.config of the folder that contains the file, there is a <deny users="*" /> line.
View 4 Replies
Nov 12, 2010
I am not sure this is the forums but I dont know where to write this and this is an EMERGENCY ::I had windows 2003 server. on C: and I have installed windows 2008 server.I had SQL server installed and all of the database files stored inside c:program filessql server....PROBLEM is that after I installed 2008 server I can see 2 folders of program files one for x86 and the other for 64 bits.
View 2 Replies
Dec 24, 2010
I have a form with 10 file inputs. They can contain 10 random files with random sizes. If I send these files to ASP.NET server with this code:
var count = HttpContext.Current.Request.Files.Count;
var TotalSize = 0;
for (int i = 0; i < count; i++ )
{
HttpPostedFile postedFile = HttpContext.Current.Request.Files.Get(i);
TotalSize += postedFile.ContentLength;
}
And as you can see I didn't save the files on the server, will this code just calculate the summary of files without need to receive the whole file from the client (And therefore it would be very fast)?
View 1 Replies
Jun 5, 2010
i have a production server that does not have ftp access. Possible way to deploy files is connecting with remote desktop client and send files.
As you know this approach is highly hard and time inefficient.
View 4 Replies
Aug 26, 2010
I am trying to open different types of files that I have uploaded on my sql server database. I would like to display all the list of files in Gridview. When user click the link it should open download dialog box and should be able to open its particular applications such as word, excel, browsers etc.
View 3 Replies
Apr 16, 2010
I need to populate a database (SQL Server) with some data from a templated excel document.Here are some approaches:
A) User upload a file.xls or file.csv that the server reads, checks and updates the database (cons:the uploaded file might be too big. file.* needs to be in correct format)
B) User downloads a tool.exe to read and upload file.xls (cons: maintenance of the tool.exe)
C) Use of a web service in excel? (don't know how to do it) but
this article might give you a hint
Which one is the best to use? Are there any others?
View 4 Replies
Apr 15, 2010
I've inherited a bunch of code that has server script inside of .htm files.
On IIS, a handler mapping pumps.Htm pages though the asp.net engine.
Unfortunately, visual studio doesn't notice that they should be treated as code.
Is there any way to make VS treat .Htm files as code/aspx files?
View 3 Replies
Jun 28, 2010
I upgraded my site from asp to asp.net.This means that all of my previous asp files became obsolete.I don't want to lose my Google Ranking of the old pages.
What is the proper way to redirect?I tried to catch all of the old asp pages is my 404 and then to:
if Request.QueryString("aspxerrorpath").contains("index.asp") = true then
Response.Status = "301 Moved Permanently"
Response.AddHeader("Location", "http://www.domain.com/index.aspx")
Response.Redirect("/index.aspx")
end if
but it doesn't catch asp pages, only aspx.
View 3 Replies
Oct 11, 2010
I'm populating a generic list from an excel file that contains names of pdf files. Now I want to take each item in the list and create a file from it. Here's what I have so far:
[Code]....
So now, the list called lines contains names of 900 pdf files. How would I take those names out of the list and create files from them?
View 1 Replies
Mar 16, 2010
UrlRewritingNet to my project now i can rewrite urls but i dont wanna rewrite images css files js files etc i only want to rewrite url as you can also guess for example how do i need to edit this code to achive this
<add name="Rewrite" virtualUrl="^~/PokePokedex/(.*)/(.*).aspx"
rewriteUrlParameter="ExcludeFromClientQueryString"
destinationUrl="~/Pokedex-Pokemon.aspx?PokemonId=$1&PokemonName=$2"
ignoreCase="true" />
View 4 Replies
Nov 9, 2010
I have a designer working on several pages in Dreamweaver. The designer is creating .aspx files with the Page directive at the top. These are getting shipped to me and I'm adding them to the Visual Studio ASP.NET WebForms Web Application Project. The problem is that there's no code-behind file by default, and I'm trying to find a shortcut to have them autogenerated as if I've added a fresh page from Visual Studio.
View 3 Replies
Mar 25, 2010
My Visual Studio 2005 program doesn't open CSS files properly - when I open them in VS, it opens them as a text file. It is annoying because if I do something wrong, it doesn't show up the error and I have to sift through it all to try and find out what is wrong. Plus it doesn't show up the hints for the attributes.
View 5 Replies
Mar 2, 2011
What's the easiest way to delete all the files from my Temporary ASP.NET files in .NET 4.0 on my development box? It seems like I have to shutdown Visual Studio 2010, stop IIS, and then it will let me. Is there a simpler way?
View 1 Replies
Apr 21, 2010
Class file Conflicts in C:WINDOWSMicrosoft.NETFrameworkv2.0.50727Temporary ASP.NET Files is preventing me from building the solution. Even though I try emptying out the folder, each time Visual Studio starts the build process, it brings in the class file in to the temp folder with the same folder name. If I restart the machine or leave it overnight, project build without error. Is there anyway to tell Visual studio to delete/ignore/clean any lingering class files that could be in the temp folder?
Clean solution option in VS doesn't work either. Class file in conflict are from the App_Code folder.
View 4 Replies
Aug 27, 2010
How the url is mapped to the WebForm? First, say I have a WebForm in a directory (and/or namespace) like this: alongpath oa And then what would the corresponding url be? Would it be like /a/long/path/to/a/resource.aspx. How asp.net understand how to map urls to directory (ie how to locate the resource)?
Second, if I want the url structure to be different from the directory structure then how to store the map? Say the URL is like this: /a/dfferent/path/to/the/resource.aspx Then how to store the mapping? In addition how to do the same virtual directory sort of thing with MVC2?
View 5 Replies
Mar 10, 2010
i created asp.net web aplication in VS08, where i have files(dll,cs) in app_code all work ok.When I publish this site on the IIS, the page don't find(use) .cs and .dll files. I converted folder to the web aplication and try all posibilites but didn't work.
View 1 Replies
Jan 11, 2011
I have recently set up some hosting space. The problem is whenever I upload flv files and try to reference them directly they can't be found even though I have specified the MIME type in the web config file. The only way to play flash files is to upload them onto seperate webspace and reference them that way. This is what my webconfig file says:
<system.web>
<customErrors mode="Off"/>
<xhtmlConformance mode="Strict" />
</system.web>
<system.webServer>
<staticContent>
<mimeMap fileExtension=".flv" mimeType="application/flash" />
</staticContent>
</system.webServer>
</configuration>
What am I doing wrong?
View 1 Replies