asp.net-mvc

ASP.NET MVC: How to use static HTML pages in MVC applications?

In the app I am working on, I want to allow the user to upload static HTML pages to replace the default "user profile" MVC View page. Is this possible? That is, the user uploaded html pages will totally run out of MVC, and it can include its own CSS links, etc. Ideas? Suggestions? ...

ActionLink CS1026: ) expected

I get the above error whenever I try and use ActionLink ? I've only just started playing around with MVC and don't really understand what it's problem is with the code (below): <%= Html.ActionLink("Lists", "Index", "Lists"); %> This just seems to be a parsing issue but it only happens when I run the page. The application builds perfec...

ASP.NET MVC doesn't work with ViewState and Postback?

Perhaps this is a naive question. In my understanding, ASP.NET cannot work with ViewState and Postback which is fundamentals of ASP.NET forms. Is that correct? If that's it, then all ASP.NET Web Controls depending on ViewState & Postback cannot be used in ASP.NET MVC, right? ...

Can you explain to me the Action parameters for MVCs Controller methods?

Can someone explain to or link to an article that explains how the parameters passed into the action of a controller are populated? I understand the basic mapping when you have the Controller/Action/ID and the ID is passed in as a variable, if it doesn't convert to the type that you are asking for then it won't be passed in to that actio...

How can I unit test my ASP.NET MVC controller that uses FormsAuthentication?

I'm working with a ASP.NET MVC solution in a test driven manner and I want to login a user to my application using forms authentication. The code I would like to end up with in the controller looks something like this: FormsAuthentication.SetAuthCookie(userName, false); My question is how do I write a test to justify this code? Is th...

Creating urls with asp.net MVC and RouteUrl

I would like to get the current URL and append an additional parameter to the url (for example ?id=1) I have defined a route: routes.MapRoute( "GigDayListings", // Route name "gig/list/{year}/{month}/{day}", // URL with parameters new { con...

Top Issues Running ASP.NET app on Mono

Assume I have an ASP.NET MVC app that's not doing anything too fancy (no P/Invoke, no unsafe, etc). I've considered the idea of running on Mono to support Linux, among other platforms. I haven't used Mono in a long time. What are the top issues I'm likely to face? ...

Browsable website while version-controled?

I browsed around here on Stackoverflow and found this topic : http://stackoverflow.com/questions/279/aspnet-visual-studio-and-subversion-how-to-integrate However that didn't help me in my case, or i might just be a little stupid. So to my problem! Installed VisualSVN on a Server far far away and while this works perfectly, i can add m...

Would the MSFT Report Viewer (rdlc) Work with MVC

I am interested in learning MVC, and have experimented with a couple of the sample apps. As a project, I'd like to move part or all of my own office app to MVC. An important part of this app, and of ALL of my apps for customers, is the printing of invoices, purchase orders, inventory lists and so forth. In fact, one of their main crite...

Model Warnings in ASP.NET MVC

I'm currently using the ModelStateDictionary in asp.net mvc to hold validation errors and pass then back to the user. Being able to check if the whole model is valid with ModelState.IsValid is particularly. However, a current application I'm working on has a need to be able to report warnings. These aren't as critical so the form content...

ASP.NET MVC & Ajax Control Toolkit

Hi, I'm trying to get my head around MVC + AJAX etc. One of the things I like about coding "old skool" (web forms) is the AJAX Control Toolkit. I saw on the Microsoft Storefront video 14, Rob Conery uses the TextboxWatermark control. When I downloaded the code though, I couldn't find any reference to the Watermark control or any othe...

ASP.NET MVC Routes to Mimic Object Graph Traversal?

I'm new to ASP.NET MVC and all tutorials, samples, and the like I seem to find are very basic. Is it possible (and if yes, a good design) to have routes like so: .../Organization/10/User/5/Edit .../Organization/10/User/List In other words; can the urls mirror your domain model? ...

Changeing the ID of a MVC Router from an integer to a string in vb.net

Hi - i'm looking at some pages, and i've noticed that by default for ID in the routing for controller/action/ID is an integer and not a string. How can I change it so it is a string? ...

select list usage in asp.net mvc

I am working on an MVC site that is the first my company has done, one of the things I find myself doing a lot is creating selectlists in a controller, putting them in viewdata and reading them when creating a html.DropDownList. theer are a few things that strike me as smelly about the way i do it. 1) some pages can repeat lists of thin...

How to post a form with MVC controller?

How do I post a form to an external site using an ASP.NET MVC controller? EDIT: Ok... I have a view with some data on it. After the user completes the form I need to do a postback with a specified form format to an external site (like for paypal). After I posted the constructed form I need to redirect the action to a new view ...

ASP.NET MVC Access Application Property from Model

my global.asax looks like this Imports Castle.Windsor Imports Castle.Windsor.Configuration.Interpreters Public Class MvcApplication Inherits System.Web.HttpApplication Implements IContainerAccessor Private Shared IoC As IWindsorContainer Shared Sub RegisterRoutes(ByVal routes As RouteCollection) routes.IgnoreR...

ASP.NET MVC and Paging - Search & Result Scenario

I have forms in my page a get and a post and i want add pager on my get form .. so i cant page through the results.. The problem that i am having is when i move to the second page it does not display anything.. I am using this library for paging .. http://stephenwalther.com/Blog/archive/2008/09/18/asp-net-mvc-tip-44-create-a-pager-htm...

How difficult is it to develop an ASP.Net web application that runs under Mono and Windows?

We are about to develop a web app from scratch using ASP.Net, and would like it to be as platform-agnostic as possible. As far as I know, the only two options for this are IIS on windows, and Mono (via Apache) on Linux. The app will be follow the MVC architecture, so with all of this in mind, how difficult is it to develop the applicati...

Using a strongly typed ActionLink when the action method doesn't take a primitive type

Hi, Does anyone know how I could go about doing something like : Html.ActionLink(c => c.SomeAction(new MessageObject { Id = 1 } )) This should output a link with the url of "/Controller/SomeAction/1", pointing at an ActionMethod along the lines of: public Controller : Controller { public ActionResult SomeMethod(MessageObject messag...

How do you pass an arbitrary bit of data to a user control in ASP.NET MVC using Html.RenderPartial()?

I have a strongly typed user control ("partial") and I'd like to be able to pass it some additional information from its containing view. For example, I have view that's bound to a product class and i have a partial that also is strongly typed to that same model, but I also need to pass an additional parameter for imageSize to my partia...