Way To Put Class Mapping In Web.config, Rather Than In Embedded Xml
Feb 4, 2011
Using raw nhibernate (no Fluent), is there a way to put class mapping in web.config, rather than in embedded xml? I can't seem to find any documents on this
View 2 Replies
Similar Messages:
Mar 14, 2011
I have an application with an HttpHandler that processes any requests for a .js file. I only want this handler to process *.js files that are requested in the root of the application.
The handler mapping looks like this:
<add name="HandleJS" path="*.js" verb="*" type="MyApp.JsHandler" resourceType="Unspecified" requireAccess="Script" preCondition="integratedMode,runtimeVersionv4.0" />
Currently, this handler processes ALL requested *.js files. Here is an example of the behavior I want.
This request would be processed by the handler: http://localhost/myapps/approot/script.js
and this one would not be processed by the handler: http://localhost/myapps/approot/dontProcessMe/script.js
I'd really like to avoid including the full absolute path in the handler path so I tried some other things first.
It doesn't look like the path property of the add element allows the use of the ~/ application root mechanism, so setting path="~/*.js" doesn't work.
I've also tried replicating the StaticFile handler that's built into IIS and doing something like this:
<add name="MyStaticFiles" path="*/*.js" verb="*" modules="StaticFileModule" />
or
<add name="MyStaticFiles" path="dontProcessMe/*.js" verb="*" modules="StaticFileModule" />
Both of which just return a blank response with an HTTP status of 200.
View 2 Replies
Mar 3, 2010
What I would like to have is a mapping between a custom file extension to a class that is not System.Web.UI.Page but a class of mine that inherits from System.Web.UI.Page.
i.e.:
*.aspx -> System.Web.UI.Page
*.my -> My.Package.MyClass (inherits from System.Web.UI.Page)
I know I can map any extension to be treated like .aspx but I can't find the way to do what I have in mind.
View 3 Replies
Mar 26, 2010
Web Application Project Has project reference to Class Library 1 in same Visual Studio 2008 solution Class Library 1 Has project reference to Class Library 2 in same solution Class Library 2 Has a file marked as Build Action: Embedded Resource and Copy to Output Directory: Copy Always
When I build my Web Application Project, the embedded resource in Class Library 2 is NOT copied to the bin directory of the Web Application Project as it should. If I add a project reference directly from my Web Application Project to Class Library 2, the file IS copied to the bin directory. How can I get the embedded resource file to copy without having to add the unnecessary reference?
View 1 Replies
Mar 6, 2011
Currently in my personal website I'm building I'm using a global static Config class to hold everything configurable I might need to change that is semi-global. So right now it looks about like this:
[code]....
Is using a global config class like this an anti-pattern of some sort? Also, I prefer for my connection strings to be outside of web.config. I like my web.config to be as minimal as possible.
View 5 Replies
May 15, 2010
i am using,Asp.net(vb),database sql server 2005, i want to use sysdsn DSN for database connection,so please Guide me how do i use DSN using web.config and class(we have sqlhelper type our own DBclass to set connectionstring for whole applicatoin. which get connection string from web.config),
Now,how do i use/set dsn in this type of scenario.
View 3 Replies
Jan 5, 2011
share your thoughts if there is any way to encrypt app.config section with out changing code? I know that we can use aspnet_regiis.exe to encrypt the web.config file.
I came across some blogs to rename app.config to web.config and run aspnet_regiis -pef command. I am able to create an encrypted version of app.config file but application failed to read the keys from encrypted app.config. so this approach didnt work for me.
View 1 Replies
Jul 8, 2010
I a custom config file which I am having problems reading from a class project, is there a simple way to do this? the path does not seem to be getting picked up in code, where as this works in a web project
View 2 Replies
Oct 19, 2010
I wonder how to hard code the configuration below in a class. I have a case where I cannot use app.config (due to creation of dll). The code below is probably not enough.. hard coded in class
ContractDescription contract = new ContractDescription("Common.MyInterfaces.IConnector");
Binding binding = new NetTcpBinding();
binding.Name = "net.tcp.binding";
EndpointAddress endPointAddress = new EndpointAddress("net.tcp://localhost:9001/Connector");
ServiceEndpoint serviceEndpoint = new ServiceEndpoint(contract, binding, endPointAddress);
[Code]....
View 3 Replies
Nov 14, 2010
I am relatively new to asp.net environment.Recently working on a project, i discovered a problemi.e. I had to add using system.io to all file functions in any page. same for using sql functionsi.e. any method for that namespace had to be used in full like By adding the following section in web.config , ALL my pages automatically have access to that namespace
<namespaces>
<add namespace="System.Data"/>
<add namespace="System.Data.SqlClient"/>
<add namespace= "MySql.Data.MySqlClient"/>
<add namespace="System.IO"/>
</namespaces>
[code]...
View 2 Replies
Jan 6, 2011
I'm struggling to find a way of specifying a file location in web.config appSettings that avoids using hard-coded paths but allows a non-'web aware' C# library to find a file. The C# library uses standard File.Open, File.Exists methods, etc. to operate on a data file, which is stored in my web application (ASP.NET MVC) tree, e.g. under:
contentdataMyDataFile.txt
Requirements:
I want to be able to specify my path like, e.g.:
<appSettings>
this--> <add key="MyFileLocation" value="~contentdataMyDataFile.txt" />
not --> <add key="MyFileLocation" value="c:inetpubwwwrootfoocontentdataMyDataFile.txt" />
</appSettings>
I don't want the C# library to be aware of the web application it's being used in, as it is used in other software, and the web application has no need to know about the configuration of the C# library.
View 3 Replies
Jan 25, 2010
i'm using custom adapters to identify devices. I'm adding them in web.config like this :
[Code]....
I have create a class named AswMobilePageHtmlAdapter liek this:
[Code]....
when I try to debug the web site it gives me an error that say that it can't find the ASW_Skin_Mobile.Presentation.Adapters.AswMobilePageHtmlAdapter class.
There is something wrong in my class definition?
View 1 Replies
Oct 18, 2010
I am preparing for an Access2007 db conversion at the beginning of the year and would like to know what the best process would be for connecting to the sqlserver2005 database. I have read about adding the connection string to the web.config file. I have also read about using ADO.NET and put the connection information into a class and not the web.config file.
I would like to hear from others as to what you have used, are using, or plan on using for a webapp (vs2010), and why so I can get an understanding.
View 3 Replies
Nov 12, 2010
I have a problem getting a (very simple wep app this is) parameter to map into my action. The controller code action:
[Code]....
My global.asax:
[Code]....
Problem: Calling a url like /Ax/Delete/525782 always returns the 'ParameterNotFound'-view. Its been bugging me for several hours
View 4 Replies
Nov 10, 2010
I am using a xml file to get some values.
I am reading xml like this
Dataset ds = new Dataset();
ds.readXml(Server.MapPath("XMLFILE.xml");
I want to know that is this a better method to read xml file or storing xml path in web.config file and then using it is a better choice.
View 3 Replies
Mar 29, 2010
In Area VIPUsers I have controller ProfileController and other controllers.
If I want every method in ProfileController to have parameter (id) and every method in other controllers to have parameter (userid and id) how would I map it?
Would it be
context.MapRoute("ProfileMapping", "VIPUsers/Profile/{action}/{id}",
new {controller="ManageUsers", id=""});
and then map a default one for all the controllers?
context.MapRoute("Default", "VIPUsers/{controller}/{action}/{userId}/{id}",
new {action="Index", userId="", id = ""});
If I go to a page on ProfileController and give it two parameters after {action} (VIPUsers/Profile/SomeAction/4/4/), it'd use the second mapped route. Is that correct?
View 1 Replies
Nov 16, 2010
So I am working with a database and am trying to get my model code working.I have a situation where I have a table called accounts that for simplicity has 3 columns
accountid, accounttype, parentid
basically its a parent child relationship. if parentid is null its a parent, its not its a child of the accountid.Im running into problems getting the .edmx file mapping. parentid is a foriegn key on the table.
how can access the parentid column? i can see it in account navigation account1 but Im not sure how to get access to it in my linq query
View 3 Replies
Aug 18, 2010
I've set up a web app on IIS6 with a "{controller}.mvc/..."-mapping. Everything is running fine - except for the root-path (http://www.myapp.com). The additional routes.MapRoute for "Root" is applied in global.asax (as in the MS-example "Listing 2 - Global.asax (modified with extensions)").In VS2010 debugging mode everything (including the root) works - as well as in the "published" app (on Win7 IIS 7.5). I've copied the whole published app to the IIS6.
View 4 Replies
Sep 11, 2010
I wonder mapping mechanism from controllers to views. I can not understand how mapping can be possible If we just return value of View() method. Controller class's View() method call overloaded View method with null parameters. But how can be possible to mapping to views with none specified returning value of View() method ?
View 2 Replies
Jan 8, 2011
I have a DB's table with control_name, field_name Control_name is the web form's control name and field_name is the table's field.
I want to dynamically insert the content of the control to the particular field.
How do i do that? I do not wish to generate the SQL in C# code dynamically with string.
View 2 Replies
Mar 15, 2011
We have a requirement to post the status of installations on a Web based map. I remember seeing smething like this at the Visual Studio 2010 launch event. As I recall it was a Silverlight based web service.Has anyone done something similar?e.g. US Map, with GREEN/RED/YELLOW circles on specific Cities or GPS coordinates showing current status overall. Click on the Circle and filter down to the specific item you are looking for the status on, and would show Equipment installed, Progress complete, etc.
View 2 Replies
Mar 19, 2010
i want to update a 'name' field in my database. to do this i need user to enter
their name but i need to map their name to id field in order for correct update. i was thinking of using dictionary but not sure how to do this...
View 3 Replies
Dec 6, 2010
I have 2 users(for example: user1, user2) in the Active Directory.I have a SQL table called tblRolesforUser".
It has columns like UserId, Role type, Permission type, Project Id.
In the table:
User1 has Role type as Manager and Permission type as Contributor, and ProjectId as P001.
User2 has Role type as Manager and Permission type as Contributor, and ProjectId as P002.
I am creating a aspx page in Visual studio 2010, to add details of projects. User1 should not be adding or viewing information for project id "P002" and should add or view information for P001 only.
View 1 Replies
Oct 13, 2010
I need a brief description and concept that what is event mapping in Asp.Net?
If you have any useful link tell me. Write here if you know about this
View 3 Replies
Mar 4, 2010
I'm trying to integrate mapping into an existing website, and I was trying to figure out which flavor to use; Ajax, Silverlight or Web Services.
View 5 Replies