asp.net-mvc

Asp.Net Mvc 1.0 Installation issue

I'm try to install Mvc 1.0. I already installed KB963676 but still I have some problems. I run install with "msiexec /i AspNetMVC1.msi /q /l*v mvc.log" command and you can see install logs below. mvc.log = http://eklentiler.googlecode.com/files/mvc.log MvcTemplates.Log = http://eklentiler.googlecode.com/files/MvcTemplates.Log Have any ...

How to maintain separate layers in MVC? like Business layer and Security layer

I am familiar with three layers viz. view model & controller. Now i want to separate another two layers viz. Security layer & Business logic layer apart from these. So how do i do this? Let's say controller is ok but which user have that privilege, is i want to decide in security layer & if it pass this layer it goes to business layer...

What's the best way to respond to checkbox clicks on an MVC list view?

I've got a list view in my MVC app that shows a check box next to each entry: <% For Each item In Model%> <%=Html.CheckBox("Selected", item.select_flag, New With {.onclick = "this.form.submit();"})%> <%=Html.Hidden("ID", item.id)%> <%=item.name%> <br/> <% Next%> As you can tell from the onclick, I'm submitting the form...

Flash FileReference Upload to ASP.NET MVC

I am using a Flash/Flex uploading component in my ASP.NET MVC application. My action has a HttpPostedFileBase parameter. My action is called but my HttpPostedFileBase is passed in as null. Any ideas why it would come back null? Edit -- I believe this is on the MVC side. ...

Model design advice for ASP.NET MVC

I'm currently in the process of converting some small personal web sites from WebForms to MVC. With the existing sites, the database schema is solid but I had never really taken the time to build proper data/business models/layers. The aspx pages all talked to the database directly using a variety of Views and Stored Procedures that we...

ASP.Net MVC have An Action render another Action

I have two pages I need, and want to show for the url /index and /review. The only difference between the two pages is on the review I will have a review comment section to show and Submit button. Otherwise the two pages are identical. I thought I could create a user control for the main content. However, if I could say under the Re...

ASP.NET MVC: Use existing Account or create new User controller?

I'm creating a new ASP.NET MVC application. So far I've used the Account controller for actions related to a user's account -- Login/Logout, Activation (like Register, but I use Register for other actions in the site so I've renamed it), Add/Update Contact information. Up to now, though, I've been concentrating on the administrative use...

ASP.NET MVC on Mono

Hi, what steps should I perform in order to run asp.net mvc 1.0 web application on mono? ...

Using two strongly typed models for one MVC view

Am I missing something fundamental to the principals of MVC or am I going mad? If I have a view that displays a list of books and a list of authors, I have to create class that would have the list of Books and list of authors as properties. Right? I would then strongly type the view to use this class. Now I want to create a new page ...

Classic ASP in ASP.NET MVC (C#)

I have an application that I want to (eventually) convert to ASP.NET MVC. I want to do an all out service upgrade (to ASP.NET) but want to use current asp stuff to run the current functionality so I can upgrade small pieces while making incremental upgrades to the new framework. This site is heavily dependent on a VB6 DLL that is not v...

ASP.NET MVC "Donut caching" and TempData

Hi all! Is there any solution for accessing TempData property in the HttpResponseBase.WriteSubstitution() method This does not work: <%= Response.WriteSubstitution(x => Html.Encode(TempData["message"].ToString())) %> But this works: <%= Response.WriteSubstitution(x => DateTime.Now.ToString()) %> The problem is in request processi...

HtmlHelper methods and RouteValueDictionary

When writing an htmlhelper extension if I want to support the similarly structured ctors for my htmlhelper extension method, I use RouteValueDictionary as follows: public static string ListBoxDict(this HtmlHelper htmlHelper, string name, object value, ...

How to unit test asp.net mvc base controllers without hitting the database?

I have been using unit testing for controllers with the 'poor man's' dependency injection technique. Each controller inherits from a base controller to query data for the master page. How do I unit test the controller with it inheriting from base controller without hitting the database? public class HomeController : BaseController { ...

asp.net MVC Ajax Request Not Firing Correctly

I cannot figure out why this Ajax request is not firing correctly. For simplicity's sake I've been trying to implement Ajax request using this tutorial. However I cannot get my controller to recognize the request as being so. I've tried placing the Ajax.ActionLink within the div to be updated (outside of it here). Using the Response...

Strongly typed urls in asp.net mvc

I'm trying to URLs from the LinkBuilder in Microsoft.Web.Mvc. AT the moment, I have: LinkBuilder.BuildUrlFromExpression(???, RouteTable.Routes, x => x.Index()) But I'm not sure how to get the request context in all cases. E.g. If I'm in a IHttpModule, is it possible for me to somehow get the request context so I can create a UR...

Using Database in Unit Tests

I was running into this error An attempt to attach an auto-named database for file C:\<...>\Out\MessagesDB.mdf failed. A database with the same name exists, or specified file cannot be opened, or it is located on UNC share.. attempting to write some unit tests for testing a controler. I belived the problem was that the tests were att...

What can cause ViewData.ModelState.IsValid to become false

There are times that I find my ModelState is invalid but can not find what has invalidated it since there are no ModelErrors. What is the easiest way to determine what has invalidated your model state if you yourself haven't added a ModelError? ...

Is it possible to read a querystring in ASP.NET-MVC when hitting /mysite?q=123

I have a site that external sites are linking to with a campaign ID http://www.example.com?cid=123 or (with a slash) http://www.example.com/?cid=123 In the case where you miss off the slash most browsers will go and add it in for you. So in either case, whichever you enter the URL that my application is hit is the seco...

ASP.NET MVC View - Display something base on Authorize

Hi all, Sorry if you found that I'm asking stupid questions. But I'm new to asp.net and I'm facing a problem: I'm writing a simple blog to learn asp.mvc, and I want to display an Edit link next to the blog Title if the user is logged in. Currently I have to add the currentUser object to Model and check the IsLogged properties to decid...

A word that do so the ASP.NET (MVC) Routing crashes

I read about a string/word that did so the Routing crashed but I can't remember which word/string combination it was. Example: http://stackoverflow.com/questions/685039/microsoft-logging-application-block-and-multi-threading - works http://stackoverflow.com/questions/685039/hello - works http://stackoverflow.com/questions/...