mvc

Missing images/css when using routedata inside Application_PostAuthenticateRequest

Hi, I'm having some weird behaviour when i use the following code inside the httapplication: protected void Application_PostAuthenticateRequest { RouteData Data = RouteTable.Routes.GetRouteData(new HttpContextWrapper(Context)); string x = Data.GetRequiredString("xxx"); } When that code is in place, the html pages are missing all ima...

What is (self) in the python code? (OOP question)

class MyController(BaseController): def index(self): # Return a rendered template #return render('/test.mako') # or, return a response return '' Why does the function "index" have "self"? I got this code from Pylons controller ...

Lightweight MVC - no framework

Hi sorry if this is a naive question, but what did people do before mvc frameworks became so popular? All you hear of nowadays, and im talking php here, are mvc, Zend etc but what did developers do beforehand? Are there some developers who use the mvc pattern but without a framework - if so how do they do this and is it really complica...

RedirectToAction help: or better suggestion

Still getting my feet wet with asp.net mvc. I have a working Action and httppost action but I want to replace the "iffy" code with a RedirectToAction call because the code is rather large for what it does. A call using RedirectToAction would clean it up more. Every way I've tried it fails to work for me in that the drop down list fails t...

Using Entity Framework V4 - Mapping Stored Procedures with XML output

I have been attempting to implement the Entity framework into my project and unfortunately it seems like mapping an XML result set from SQL is not something that is supported. I also have issues with returning multiple result sets, though I understand that the EFExtensions was created to try to mitigate that issue. Is there a way to ta...

In CodeIgniter, how to clear "form data" after redirecting page

I'm not sure I explained it correctly in the question title, so here's the details: Login controller: function authenticate() { if ( authorized ) { redirect('lobby'); } else { redirect('login'); } } Lobby controller: function index() { //load lobby view } What happens is that in the login page, I en...

Unable to pass attribute from controller to view

I'm using Spring MVC 3 for a web app. In the app a URI template is supposed to be handled by a controller method, which then passes an attribute to a view. Currently, the controller does handle the request, and it even forwards to the correct view. However, it does NOT pass the attribute to the view. Below are the URI template, controlle...

asp.net mvc dialog box mechanics at the end of the request

<form action="/Home/JSONRequest" method="post" enctype="multipart/form-data" onsubmit="return submitForm(this)"> <input type="file" name="file" id="file" /> <input type="submit" name="submit" value="Submit" /> </form> <script type="text/javascript"> function submitForm(frm) { var tdata = $(frm).serialize(); $.aj...

Retrieving postback from Dynamically created controls in MVC without using FormCollection

I'm passing a List to an MVC view and generating checkboxes for each object in the list (The checkboxes are named t.Name). I'd like to be able to tell which checkboxes were checked once the form is posted. However, I'd like to avoid using the FormCollection object. Is there any way to do this? ...

code igniter codeigniter question, making anchor load page containing data from referenced row in DB

Hi, Im trying to learn the code igniter library and object oriented php in general and have a question. Ok so Ive gotten as far as making a page which loads all of the rows from my database and in there, Im echoing an anchor tag which is a link to the following structure. [code]echo anchor("videos/video/$row->video_id", $row->video_ti...

.NET MVC Code Generation

Is there a way to force the MVC automatically generated code to follow the conventions you have set in your preferences? For example, I keep all curly braces on the same lines as their declaring class, method, etc, but when generating a controller, it completely disregards my settings. Is there a setting someplace to force the same cod...

What is the order of execution when dealing with .NET MVC 2 Action Filters?

Say I have: [Attribute1(Order=0)] public class Controller1 { [Attribute2] [Attribute3] public ActionResult Action1() { ... } } The attributes get executed in the following order: 2, 3, 1 This makes sense because attributes 2 and 3 have an order of -1 and will be executed before attribute 1 which has an explici...

Is my System Administrator crazy :-) Does ASP.NET MVC break when the server's Physical Path is in UNC format?

Hey Everyone, I'm trying to get my company to move to ASP.NET MVC and away from classic ASP. I've written some sample applications as proof-of-concept but now I'm running into problems as I try to deploy these mvc applications to my company's IIS7 server. My System Administrator says that there is something in ASP.NET MVC that is prev...

How to get the NHibernate ISession that is HttpContextScoped by StructureMap.

Hi all I'm somewhat new to the MVC framework and in accordance with the following post: NHibernate with StructureMap I am not sure how to actually get the HttpContextScoped ISession in my controller? I'm sure there is a simple way to do this but I am unsure. Also, it's a small project and I don't want to go overboard with Enterprise D...

Can I use System.Web.Mvc from a Class Library?

I'm working on an ASP.NET MVC application, but I'm trying to remove everything but Controller code from my project and put it in it's own Class Library. I've got some code that is Using System.Web.Mvc; But it doesn't seem to be letting me access it. I have Referenced the System.Web Namespace in the project. Bassically I'm gettin...

Excluding an action from authorization in ASP.NET MVC 2

I am using forms authentication in my ASP.NET MVC application. I want to the signup page from the authorization process. I know I can add a location tag in my main web.config file or create a new web.config inside the specific folder. But I just to exclude one specific action in the User controller. How do I do it? ...

ASP.NET MVC Error Handling - Remove aspxerrorpath

I'm working on some error handling in my MVC app, and I'd like to change asperrorpath to something that doesn't give away the fact that I'm using .NET... something like path Can anyone give me some direction on how to change that out? ...

how to resolve Error: $ is not defined in jquery?

i am using asp.net mvc in that i am using partial views but i get the following error Error: $ is not defined Line: 159 it is for the java script its not getting reference. i included the java script in site.master <script src="../../Scripts/jquery-1.2.6.js" type="text/javascript"></script> <script src="../../Scripts/jquery-...

Routing in ASP.NET MVC 2.0

I'm looking to make a really simple route in my ASP.NET MVC 2.0 website. I've been googling for help but all the examples I can find are for really complex routing. Basically I want all the pages in my Home Controller to resolve after the domain as opposed to /Home/ For example I want http://www.MyWebsite.com/Home/LandingPage/ To bec...

How to set up SubSonic ActiveRecord Repository in the ASP.NET MVC Starter Site

I would like to setup ActiveRecord iSession with Ninject IoC just like SubSonicSimple is done. http://mvcstarter.codeplex.com/ Pls help ;) ...