mvc

Logging in with a ReturnUrl pointing to a POST action: FAIL!

I have an Asp.Net MVC project with the typical forms authentication that redirects the user to a page upon successful login. If there is a ReturnUrl in the querystring it will redirect the user to the ReturnUrl. Problem comes when a logged in user sits on a page long enough for their login to time out and then submits the form causing a...

How can I make a parameter on an Action Method be a Model Class

Hi all, I'm new to asp.net mvc and I came across a project a while back which included an actual Model class as a parameter on an Action Method. It looked something like this: public ActionResult Index(PersonFormViewModel person) { id = person.Id; ...etc.. } Can anyone point me to some samples on how to implement something like th...

.net mvc redirect to external url

Hi, I'm trying to redirect to external url from an action method but can't get it to work. Can anybody shed some light on my error? public void ID(string id) { string url = string.Empty; switch (id) { case "DB2FCB11-579F-4DA2-A68C-A6495B9BAAB5": url = "http://www.somesite.com"; ...

jQuery DatePicker and JQuery Modal Popups Issue in MVC

I have a situation where I have a form with: a view popup1 (with popup1.js) popup2 (with popup2.js) I have set the input boxes to have a class of either popup1Date or popup2Date in case the issue was coming from having them all set to the same date class. The isuse occurs if I go into popup1 - close - then into popup2 - select a da...

SIMPLE PHP MVC Framework!

I need a simple and basic MVC example to get me started. I dont want to use any of the available packaged frameworks. I am in need of a simple example of a simple PHP MVC framework that would allow, at most, the basic creation of a simple multi-page site. I am asking for a simple example because I learn best from simple real world exam...

How to convert from php to MVC in codeigniter

I have the following db and php. I am tring to make a unodered list of category menu. The orginal php is working by itself. I am trying to convert this to MVC in codeigniter and the following is what I got so far and not working. If someone can point out what I am doing wrong, I will apprecitate it. Database CREATE TABLE IF NOT EXISTS ...

PHP MVC - How to design?

I'm relatively well versed in designing websites. I mostly go for LAMP where I already have a small "framework" of my own, that I use. In short, it separates the logic from the layout and I have basically one logic file to one or many layout files depending on what views are supported in the layout. There's an admin section and there are...

How to Preserve Value of JQuery Search in ASP.Net MVC

I have an MVC view where I have a search box. On keyup, I perform a JQuery search and render the results to a div> <asp:Content ID="Content2" ContentPlaceHolderID="MainContent" runat="server"> <script language="javascript" type="text/javascript"> $(document).ready(function() { $("#SearchTextBox").keyup(function() { $("#MyEntity...

$.getJSON Sends Null Parameters to MVC Controller

I'm using JQuery's getJSON method to retrieve some data from an MVC controller. [AcceptVerbs(HttpVerbs.Get)] public ActionResult GetContacts(int? numberOf) { List<Contact> contacts = (numberOf != null && numberOf > 0) ? _provider.GetContacts(Convert.ToInt32(numberOf)): _pro...

MVC pattern with dynamic, tree stuctured data

I'm experimenting with this hybrid MVC pattern, though the question probably pertains to a range of patterns. It works great for many common situations. However, I now have a control that represents an arbitrary-depth tree similar to a file system. It's possible to turn each tree node on or off ("checked"). I'm stuck trying to figu...

MVC... how and why, and what other good options are there (PHP)?

All the examples I've seen of what and how MVC SHOULD be have used classes as the models, classes as the controller, and HTML templates as the view. And all of them consisted of one index.php script and different requests in the url to run the entire site. So they've all been something like... MODEL class User{ function getUser($u...

need help with mvc & routes

I'm very new to MVC and I'm trying to get a new site set up using it. For SEO reasons we need to make the url of a page something like "Recruiter/4359/John_Smith" or basically {controller}/{id}/{name}. I have that working when I create the url in the code behind like so... //r is a recruiter object that is part of the results for the ...

Non-CRUD Controller Actions

Hi All, This might seem like a n00b question, but I am trying to break some of my bad practice that I may have adopted using MVC, so I hope you can help me out So, imagine I want to do something like "Upload CSV And Parse It", it doesn't seem obvious to me to fit it into the CRUD pattern... I am not interacting with the DB, so i don't ...

IIS7 + ASP.NET MVC Client Caching Headers Not Working

Hey folks I've deployed an ASP.NET MVC app on IIS7 and Windows Server 2008. I've read posts on here, and around the web, but can't get the darn client-side caching to work. I'm trying to cache everything in the /Content folder. So far I've select that folder in IIS manager, and set the appropriate HTTP Response Headers (under Common ...

Dealing ASP.net Routes with n slashes using regex

I need to use a URL like this: http://mydomain.com/Box/Categ1/Categ2/Categ3/.../CategN/id1,id2,id3,...,idN Then I tried to create a new route this way... routes.MapRoute( "Box", "Box/{data}", new { controller = "Box", action = "Index"}, new { data = @"([a-zA-Z0-9-,]+/?)+" } ); But it just doesn't work. If I use any c...

Problem with Strongly Typed Views

Having some problems with strongly typed views in ASP.Net MVC... Master Page: <div id="footer-container"> <div id="actual-footer"> <% Html.RenderAction("GetFooter", "Footer"); %> </div> </div> This I think should call the GetFooter action on the FooterController class? Model (/models/PageFooter.cs): namespace We...

How to acess multiple classes through one parent class in PHP

Lets say I have a class called PageBuilder which I instantiate, send parameters to and call functions from through my index file (which acts as a front controller). There are three sub classes associated with the PageBuilder class: Head, Body and Foot, that are accessed by PageBuilder which basically abstracts them for index. So in the...

need sample of jquery modal dialog content loaded from controller action

My ASP.NET MVC app opens and displays the dialog fine however I can't figure out how to get DB content into it. I have read about making an ajax call to get the data. My disconnect is how it gets displayed in my . Any links where this is done (full code). Thanks. ...

mvc and the back button

I'm new to mvc so I don't know if there is a trick to this or not. When a user runs a search on a site I'm building and I take them to the results page, if I click the back button the search form is empty. Is there some way to keep the form fields populated as they were when going back (without resorting to session)? Thanks. ...

Trying to load JQuery modal (file upload) dialog with DB content.

I am trying to get a modal dialog which will be used to upload files to the server to display some content relative to the item selected in a grid. I'm getting errors in the jquery load method attempting to call my controller action. Initially the error I got was that it could not find the controller. I modified the path parameter in the...