asp.net-mvc

Best way to page asp.net-mvc page with POST

I have an action method that that returns a PagedList<> after a form's POST request. I would like to add paging to this page, but all paging scenarios only seem to work with GET requests. Currently the only way of adding paging controls is adding a bunch of forms with one button for navigating the page. This will look but ugly (all form...

NET 3.5 - MVC PetShop application?

is there really a MVC PetShop application? ScottGu mentioned something, but was he kidding? ...

Can't Get ASP.NET MVC Form To Post

I am having problems getting my form to Post to my Save method in a controller. I am new to MVC, and have followed several examples to try to get this to work. Here is my html markup: <form action="Edit/Save" method="post"> <fieldset> <legend>Personal Information</legend> <table class="editGrid"> ...

How to organize Controllers and Views into namespaces or subfolders?

I'm working on an ASP.NET MVC application. The app is broken up into a dozen "sections", each of which has multiple tasks the user can perform. Many of these subtasks deserve their own controller, I don't like "kitchen sink" controllers. I want to organize my controllers by adding a namespace hierarchy: Foo.SubFoo1.List Foo.SubFoo2.Li...

ASP.NET MVC - Html.DropDownList - Value not set via ViewData.Model

Have just started playing with ASP.NET MVC and have stumbled over the following situation. It feels a lot like a bug but if its not, an explanation would be appreciated :) The View contains pretty basic stuff <%=Html.DropDownList("MyList", ViewData["MyListItems"] as SelectList)%> <%=Html.TextBox("MyTextBox")%> When not using a model...

jQuery UI datepicker doesn't work in IE7

I've have finally got the datepicker to work on my MVC demo site. One thing though it doesn't work when browsing with IE7, I havn't testet with IE6 yet. Does anyone know how to fix this problem or can't I use jQuery if I want IE users to be able to pick dates? It works like a charm on Safari and Firefox, except for it's position when dr...

How to make a fully customizable hosted ASP.NET MVC application

This is related to my previous question regarding serving static html files but that doesn't seem to be a good solution, I want to make a fully customizable ASP.NET MVC application as a hosted service. See allowing the user to customize the look/feel of their own page but it is still dynamic, meaning the data is hosted in the central d...

Does anyone beside me just NOT get ASP.NET MVC?

I've been fiddling with ASP.NET MVC since the CTP, and I like a lot of things they did, but there are things I just don't get. For example, I downloaded beta1, and I'm putting together a little personal site/resume/blog with it. Here is a snippet from the ViewSinglePost view: <% // Display the "Next and Previous" links ...

asp.net mvc authorization using roles

I'm creating an asp.net mvc application that has the concept of users. Each user is able to edit their own profile. For instance: PersonID=1 can edit their profile by going to http://localhost/person/edit/1 PersonID=2 can edit their profile by going to http://localhost/person/edit/2 Nothing particularly exciting there... However...

Let OutputCache vary by logged in user?

--Edit-- Found duplicate myself: http://stackoverflow.com/questions/290098/aspnet-mvc-caching-vary-by-authentication I have a page that does never change except for the "Welcome [username]" message in the master page. I had the [OutputCache(Duration = 60, VaryByParam = "None")] attribute on the action, but this off course caches the ...

Would you use this ASP.NET MVC view syntax?

I proposed what I think is a better syntax for ASP.NET MVC views in this question. Since that question has been answered, I think my answer will generate little feedback, so I am posting it as its own question here. ...

Best Book(s) for ASP.NET web applications?

I'm looking for a book that can help me setup up web applications using ASP.NET. I'm not looking so much at the coding side (i.e. C# or the .NET framework) of things, but rather the actual building up of a website from scratch. So perhaps the book is more HTML/Javascript/CSS. So basically, I have a 'blank piece of paper', and I want to ...

How to switch master page depending on IFrame

I want to use an IFrame in my ASP.Net MVC application, yet I want to retain the layout when the internal pages are navigated via direct access (Search Engine). How would I switch the master page based on whether the View was in an IFrame, or a top level window? ...

Code behind/beside Model (.cs-aspx.cs-aspx) VS MVC model, what is the difference really?

Hi guys, What are the basic differences between classic .cs-aspx.cs-aspx (code behind/beside) model and new MVC model? regards, 2 Steps Solutions guy. ...

Which Unit test framework and how to get started (for asp.net mvc)

I'v never done unit testing before, but now I am willing to give it a try. What framework is best for starters? Pros and Cons what should i read before i begin any coding? Books/Articles/Code/Blogs is there any opensource "sample projects"? I will be usign it with asp.net mvc/C#. ...

What is the best way to use MicrosoftReportView control in ASP.NET MVC framework?

Exactly same as the title of my question, What is the best way to use MicrosoftReportView control in ASP.NET MVC framework? I need to use report viewer control in asp.net mvc application, but I am so confused that how to use that control in mvc framework without violation of mvc pattern. Thanks in advance. ...

Budget NLB policy for 3 tier website needed

We have a few 'classic asp' client facing websites feeding off a central asp.net mvc site which acts as a webservice ie we query the MVC controllers directly from the ASP sites with extensive use of jquery ajax. This MVC site in turn queries sql server running on a seperate box. We have a custom session profile which requires a call to t...

Passing data to a jQuery UI Dialog

I'm developing an ASP.Net MVC site and on it I list some bookings from a database query in a table with an ActionLink to cancel the booking on a specific row with a certain BookingId like this: My bookings <table cellspacing="3"> <thead> <tr style="font-weight: bold;"> <td>Date</t...

How do you write your own View engine for ASP.NET MVC?

I know that ASP.NET MVC will allow me to swap in various View engines that other people have created, but I am wondering how can I create my own View engine? More info: We have our own webforms based CMS and the main selling point about MVC is that it gives us cleaner HTML (which our designers would love). However we have a desire to cr...

What is the most efficient way to perform the reverse of Server.MapPath in an ASP.Net Application

I am building an MVC application in which I am reading a list of files from the file system and I want to pass the relative URL to that file to the view, preferably prefixed with "~/" so that whatever view is selected cab render the URL appropriately. To do this, I need to enumerate the files in the file system and convert their physi...