MVC :: Subfolders Within Controllers Folder?

Feb 4, 2011

I am developing a restful web api using asp.net mvc and trying to extend the MVCWEBAPI project on codeplex that i took from here - http://code.msdn.microsoft.com/MvcWebAPII have added a folder nested within API folder inside the Controllers folder.This path does not work - (nested folder Security)http://localhost/API/Security/Authentication/LoginAlthoug, this path works - (not nested)http://localhost/API/Media/GetMediaThe folder structure is Controllers ->APIWithin API folder I added a Security folder and then added AuthenticationController under it.To make the routing work, I updated global.asax.csBelow is the required code.

public static void RegisterRoutes(RouteCollection routes)
{
var map = new NameValueCollection();

[code]...

View 2 Replies


Similar Messages:

Website In A Test Folder (Subfolders)?

Jan 7, 2010

test my site using a test folder called /testing...

Suppose i have the following files:-

MasterPage.master

Default.aspx
[code]...

When i put ALL these files/folders into a folder called "testing" i get an error something on the lines of "MachineApplication etc..", I suppose a lot of people have had problems with this.

But how can i run the site on using a test folder like i want?

View 4 Replies

Web Forms :: Deleting A Folder And Its Subfolders And Files?

Nov 3, 2010

new to asp.net I'm trying to dynamically delete a folder so far I have this code

[Code]....

This works well when there are no files or folders in the directory. But if the directory is not empty then I get an error. How can I delete all the files and folders within that directory

View 1 Replies

How To Handle Every Request To A Folder (including Requests To Subfolders Within)

Jan 27, 2010

I have a folder structure that is odd and I need to find a way to deal with. Example, if you go to site.com/x/y/z/, I would like to have a script in the /x folder that grabs all incoming requests, even if the request was to /x/y/filename or /x/y/z/1/2/filename. Is it possible?

View 1 Replies

AJAX :: Controls Work In Subfolders But Not In Root Folder?

Jan 8, 2010

EDITED To make issue more clear. I have also discovered this same issue with validatorcallout extensions used in a usercontrol in a root page and a subfolderpage

I have a strange issue I cannot figure out. I have a usercontrol that is used to display news story details. One of the requirements is to be able to email the story to someone. In this control I have included a modal popup to do contain the email form. What is really strange is that if the control is used in a page in a subfolder themodalpopup works as designed but when the control is in a page in the root folder while the usercontrol still works, themodalpopup control stops working.

Controls/StoryDetails.ascx

[Code]....

This control gets placed within a masterpage via a base MasterPageClass when there is a storyid in the querystring object

[Code]....

When the master page resides at the root level the popup doesn't work but in anyother folder it does work.

View 3 Replies

.net - FormsAuthentication For Multiple Subfolders?

Sep 9, 2010

When i tried to implement form authentication in various subfolders i am getting an error as follows:it is an error to use a section registered as allowDefinition='MachineToApplication' beyond application level. This error can be caused by a virtual directory not being configured as an application in IIS.

<location path="HelpDesk">
<system.web>
<authentication mode="Forms">
<forms loginUrl="Helpdesk/Default.aspx" />
[code]...

View 1 Replies

MVC :: Subfolders In The Views And Routes

Mar 21, 2011

I'm looking to add more organization to my Views folder by adding subfolders to the existing structure.

Views

Configuration

Controller

View View
Controller

View

Controller

View
Controller

View

So in order to add the "Configuration" subfolder, I attempted to add a route to the routetable:

[Code]....

This results in a 404 error.

All of the similar posts I've seen on this site and the web have to do with adding "areas" which don't seem to be applicable in the MVC3 arena.

View 2 Replies

Web Forms :: Control Isn't Shown In Subfolders?

Feb 3, 2010

I've added a .ascx control in a Master Page in the site's root. It is perfectly shown when the page is in the same master page path (in the root in this case), but when the page is contained in a subfolder, the component isn't displayed.

View 2 Replies

Web Forms :: How To Use A Treeview To Link To Files In Subfolders

Feb 19, 2010

I have a folder "hr" on my "WebApps" site. In that folder, are a severl subfolders: MS, NC, VA and so forth. Each subfolder contains a series of .pdf documents. Rather than create an .aspx page in each subfolder with a corresponding static link in a default-type page in the parent folder, I thought it would look better to set up a treeview which lists each subfolder name and, when clicked on, displays links to the files inside each subfolder. So far so good. Where it's breaking down is the actual link to each document.

Is there a way to set the hyperlink up programmatically?

This is my treeview code (nothing fancy):

[Code]....

[Code]....

I'm just not sure where to go from here.

[Code]....

View 2 Replies

App_Offline.htm Doesn't Work For Subfolders Of Application In IIS?

May 10, 2010

I have placed an app_Offline.htm in the root of my IIS7 application. This works for calls to pages on the root, but not for calls to pages in a subfolder of the application.

How comes? And how to make it work also for subfolders?

View 1 Replies

Referencing Page Class In Project Subfolders?

Jan 28, 2010

I have a referencing problem in my project. I have an ASP.NET application where pages are in multiple subfolders. All pages user controls are working fine.

I just want to reference a page class that is not in the root folder (in subfolder from the root folder) in my usercontrol code-behind file like this

if (Page is ar_default){ //}Where ar_default is my page class name as it is in folder name "ar"The user control is also in the same subfolder as the page being accessed.Wnen I use the same method with pages in the root folder, there is no problem at all and it is working although I notice that the classes still not appearing in the coding drop down menu but if I typed the name correctly it work.like so:if (Page is _default){ //}When using the same code with classes in subfolders it is giving this error:The type or namespace name 'ar_default' could not be found (are you missing a using directive or an assembly reference?)I'm not using any namespaces also.

View 4 Replies

Authentication - Is It Possible To Have Multiple Login Forms To Access Different Subfolders

Mar 18, 2010

Is it possible to have multiple login pages for different folders within an asp.net application? Say I have this structure:

/admin
/customer
/login-admin.aspx
/login-customer.aspx

I have 2 different login forms. One for the admin people and one for the customers (the forms are different as the customers need to provide extra information on their login page).

In the authentication section of the webconfig file (which is at the root of the web app), I can only specify one Login page. So how can I make sure thaf if anyone tries to access a webpage in /admin they will be redirected to /login-admin.aspx and if they try to access a webpage in /customer they will be redirected to /login-customer.aspx ?

View 1 Replies

Localization - Put Resource Files (.resx) Within Subfolders Inside App_GlobalResources?

Mar 30, 2010

Is it possible to put resource files (.resx) within subfolders inside App_GlobalResources? For example:

/App_GlobalResources/someresources/myfile.resx
/App_GlobalResources/someresources/myfile.fr-fr.resx
/App_GlobalResources/othereresources/otherfile.resx
/App_GlobalResources/othereresources/otherfile.fr-fr.resx

Or, are all the .resx files placed directly inside App_GlobalResources? If it is possible to use subfolders, how do you programmatically access resources within subfolders?

View 2 Replies

Visual Studio 2005 Wont Find Files In Subfolders?

Oct 6, 2010

I am having a heck of a time with this. Visual Studio 2005 SP1 can not find my files and javascript files whenever I put it in the subfolders. In the solution explorer, I've created subolfders such as /js and /css. This is inside my main folder: AJAXEnabledWebApplication1css and AJAXEnabledWebApplication1js

In HTML code, when I put this: <script type="text/javascript" src="js/jquery-1.4.2.js"></script>
<script type="text/javascript" src="ui/jquery.ui.core.js"></script>
<script type="text/javascript" src="ui/jquery.ui.widget.js"></script> [code]...

every single one of them is highlighted that it can not find the specified file. But wait, if I add those files manually to the root folder and to the solution explorer, it is no problem!inside the reference paths for the program, I've also pointed to the root folder location:

c:document adn settingsmynamemy DocumentsVisual studio 2005ProjectsAJAXEnableDwebApplication1

View 1 Replies

Visual Studio :: Referencing / Adding Folders Subfolders In Solution Explorer?

Jan 18, 2010

i have few folders which has files & some sub folders ----- in another application

i need to add it in current application

without creating the folders/sub folder/subdolder1 is it possible to add all the subfolders as it is using add exixting item

View 1 Replies

Security :: Why A Forms-authenticated User Needs To Login Again To Role Subfolders In An IIS Server Environment

May 7, 2010

Followed the code sample of Chapter 10 (Logging in) of the Book, Microsoft ASP.NET 2.0, I created an ASP.NET 3.5 website with Forms Authentication. The sample code used Website Administration Tool (WAT) to manage the users, roles, and authorization.When running in the ASP.NET Development server environment, I can first login, then click to open the links for each for the 3 roles.

However when running the sample code in the IIS server environment, I can login but can not open the links for the role subfolders.Clicking each link popped up an error message for opening a login.aspx from the specific subfolder. I don't have a Login.aspx file in each subfolder.The 3 role subfolders were configured as the virtual folders in the IIS Server. Why the sample code worked fine inASP.NET Development server environment, but got an error message from theIIS Server environment? Why an authenticated user can not open the subfolder homepage?

View 5 Replies

Sub Areas To Group The Controllers?

Feb 17, 2011

Does the current MvcRouteHandler support something similar to Monorail's concept of an controller area? a way to group the controllers.

View 1 Replies

MVC Controllers Vs Proxy Layer?

Nov 25, 2010

i'm in a project with a service layer (WCF), a proxy layer that are between this service layer and the "controllers". Every controller should call this proxy layer to get data, and instead return a model to be rendered, returns a bigger entity that i've to convert using Linq to a more little model. Then pass it to the view.

Do you think is a good idea that this conversion be done by the controller? In my opinion the controller is not the responsable to shape the incoming object from the proxy layer. This object should be returned by the proxy layer and the controller should pass it to the view directly.

View 1 Replies

MVC :: Use Controllers To Get Data And Post?

Sep 12, 2010

I wounder if there are samples how to create Restful serivece withmvc. Or I can use MY controllers to get data and post data?

View 2 Replies

How To Unit Test Mvc 2.0 Controllers The Right Way

Jan 9, 2011

I want to test that when my form data is posted back to my controllers that the data annotations and the model binding is going to do its job and give the correct model state. After googling for a while I can't find a really good tutorial or article that shows how to do this.

Can anyone point me in the right direction? What is the best practice in this area? I have read that I may need to use moq and MVCContrib but I have not read a tutorial that makes me shout, "Yes, this is the right way to do it!"

View 1 Replies

How To Use Areas With Controllers From A Different Assembly

Jan 29, 2011

I'm starting a new ASP.NET MVC project, and I decided to put my controllers in a different assembly. Evertyhing works fine, but I have hit a problem: I created a new area in my MVC Project, called Administration. I have an AdminController Class in my seperate assembly which is supposed to return views from my Admin area, but everytime it tries to return a view, it looks for it in the wrong place (~/Admin/SomeView.cshtml Instead of ~/Administration/Admin/SomeView.cshtml) How can I tell the controller to look for views in the wanted area?

View 1 Replies

MVC :: Want To Create Two Controllers/Paths?

Sep 16, 2010

I am wanting to create a path somewhat like this: /Administration/News and have it forward to a News controller instead of it being the action.How would I go about this?

View 3 Replies

MVC :: Difference Between Controllers And Webservices?

Aug 12, 2010

I was wondering what the major differences are between controllers and webservices. I understand webservices can receive postbacks via ajax while controllers cannot. Also, when you put a webservice in a MVC site, what file structure do you use to store it? Just create a single services folder?

View 4 Replies

Can't Get New Controllers Or Views To Work In .Net MVC

Apr 19, 2010

Basically what the title says. I created a new MVC application. I'm trying to add new pages to the site, but anytime I do I get the following error:Server Error in '/' Application.The resource cannot be found.Description: HTTP 404. The resource you are looking for (or one of its dependencies) could have been removed, had its name changed, or is temporarily unavailable. Please review the following URL and make sure that it is spelled correctly.

namespace MyAppMVC.Controllers
{
public class ProductsController : Controlle{
public ActionResult Index()
[code]...

View 3 Replies

MVC :: Handling Unknown Controllers?

Nov 1, 2010

I'm currently migrating a WebForms app over to MVC. One problem I have is that some users will probably have a page like www.mysite.com/login.aspx bookmarked (or maybe some other .aspx page). Currently this will throw an InvalidOperationException stating that the controller 'login.aspx' could not be found. Is there any way I can handle this so that it redirects the user to another page?

I know I can implement Application_Error in the Global.asax file, but I'd rather not redirect on any InvalidOperationException, just when it's an invalid controller.

View 5 Replies







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