asp.net-mvc

WebResponse to HttpResponseBase. Is it possible?

Hi, In a controller action, I am manually sending a form to a remote URL using WebRequest. I successfully receive a WebResponse containing an html page to display. I would like to "paste" this response as the Response (of type HttpResponseBase) of the action. An action normally returns an ActionResult, so how do I conclude my controller...

Are there any ASP.NET MVC subscription-based starter kits or examples?

Basically something that handles the low-level "plumbing" code for a subscription-based service. I see a lot of things dealing with basic membership, but nothing that handles the subscription aspect (recurring billing, automated jobs for setting up billing, notification for billing, etc). This might be the one thing that keeps me from ...

asp.net mvc application application root issue

I have an ASP MVC application that I have deployed on a hosting service (discountasp.net) to an application folder that is a sub folder of the root application. ie: -/[root] -+/apps both root and apps are setup as application folders in IIS. When I hit the default page I get the error "The view '' or its master could not be found. T...

ASP.Net MVC: Best Practices for dbml files...

This may just be a yes or no type of question but here goes anyway... From all (well most) of the examples that I've seen for using mvc, it appears that method for creating the dbml file is just drop the entire schema of the database into it and let it autogenerate all of the linq to sql goodness. It appears that you just need one of t...

Will ASP.NET MVC 2 be supported in Visual Studio 2008 / .NET 3.5?

The ASP.NET MVC 2 preview 2 was first released for Visual Studio 2008 only. Later on, it was also included in Visual Studio 2010 beta 2. I've read that ASP.NET MVC 2 will be included in Visual Studio 2010 RTM, but is there any official word on weather or not ASP.NET MVC 2 will be officially supported in Visual Studio 2008 / .NET 3.5? ...

Render Partial ViewData Parent/Child

I have a collection of Shelves and each shelf has a collection of products. To optimize reuse I have created a partial view ProductList.ascx that is called as I loop through the list of Shelves. In the partial view I want to have an Add link for each type of product, and need the Shelf Id to do so. Since the partial view is a collecti...

Abuse of C# lambda expressions or Syntax brilliance?

I am looking at the MvcContrib Grid component and I'm fascinated, yet at the same time repulsed, by a syntactic trick used in the Grid syntax: .Attributes(style => "width:100%") The syntax above sets the style attribute of the generated HTML to width:100%. Now if you pay attention, 'style' is nowhere specified, is deduced from the na...

Getting posted values in MVC PartialView

I've created a PartialView which I render with Html.RenderPartial, passing the name of the view and the strongly-typed data item to bind to (below): <% Html.RenderPartial("SearchViewUserControl", ViewData["SearchData"]); %> The partial view has a form containing a submit button: <% using (Html.BeginForm("Search", "Home")) { %>...

ASP.NET MVC: Best way to trim strings after data entry. Should I create a Custom Model Binder?

I'm using ASP.NET MVC and I'd like all user entered string fields to be trimmed before they're inserted into the database. And since I have many data entry forms, I'm looking for an elegant way to trim all strings instead of explicitly trimming every user supplied string value. I'm interested to know how and when people are trimming s...

Creating a Web Navigation Helper Class for MVC

Hi, Im a newbie to MVC and trying to use the web navigator class in my MVC application. http://polymorphicpodcast.com/shows/webnavigator/ The class enables us to have stongly typed urls in a central class file. I have 3 questions: Is this the best way of storing strongly typed urls in MVC or does MVC has some special helper methods...

What are the benefits of using an alternate view engine?

I am playing with ASP.NET MVC and I see that there are a few alternate view engines available for it such as NHaml and Spark. My question is why would you use an alternate view engine? I don't see a benefit to having something like this: <ul if="products.Any()"> <li each="var p in products">${p.Name}</li> </ul> <else> <p>No pr...

Integrate a payment processing service with my MVC app

I'm developing a (here comes another one) SaaS and can't seem to decide on my billing strategy. I'm looking for a payment processor service with low fees, I'm NOT a fan of PayPal, any ideas??? I'm also looking for easy integration with MVC 2 I'm also based outside the US. ...

Using ExtJS with ASP.NET, Webforms or MVC?

Hello, For a scenario using 0 ASP.NET controls at all but rather an 100% extJS interface, what would be the advantages of using ASP.NET MVC or ASP.NET WebForms? And the disadvantages? Is there a OBVIOUS way to do it properly? I would love to have feedback's on your experiences. Thank you! ...

Error with AccountController and Ninject 2 and ASP.NET MVC 2 Preview 2

I'm using Ninject 2 and the Ninject.Web.MVC and using the NinjectHttpApplication Receiving the following error during the logon process: "A single instance of controller 'MySite.Controllers.AccountController' cannot be used to handle multiple requests. If a custom controller factory is in use, make sure that it creates a new instance of...

are you still creating complex user controls in asp.net MVC?

Is there a new model or best-practise for creating complex controls in asp.net MVC? Do you use code-behind or inline to mirror your view pages? ...

Configure authorized roles dynamically via a config file in MVC Application

I current have the following attribute decorating one of the action method. [Authorize(Roles = "Admin")] public ActionResult DoAdminTask() { //Do something return View(); } Currently, only users in the Admin role can invoke this method, but this will change. Is there anyway I can store a list of authorised roles in a config file, ...

microsoft facebook sdk

Hi, Microsoft recently announced their Facebook SDK. http://msdn.microsoft.com/en-us/windows/ee388574.aspx Has anyone tried using it with ASP.NET or ASP.NET MVC ? Would like your opinion. Any gotchas that developers need to be aware of ? Michael ...

JQuery getJson callback not parsing json

I used to be pretty comfortable with using jquery for json, but I'm having an odd issue tonight that I just can't wrap my head around. JQuery sends the request, the server fills it properly, but then there's no way to pull the data out of the json response. The server's ASP.MVC and serializing using the JsonResult/Json(). I'm complete...

MVC jQuery submit form (without page refresh) from JavaScript function

I'm pretty new to all this. I'm using ASP.NET MVC C# LINQ to SQL. I have an edit page that loads Authors and all their Books. The Books are loaded via an Ajax call. <script type="text/javascript"> $(document).ready(function() { LoadBooks(); }); function LoadBooks() { $(".Books").hide()...

How to use asp.net MVC routes to create Twitter style homepage

I'm trying to create twitter.com/rob to go to a dynamic page (using account/viewuser) as well as allowing twitter.com/help to go to a help page (help/index). The below code doesn't work in either order because the Default route handler always picks up ID as controller because controller/action/id are all optional. Is there any way to d...