asp.net-mvc

Route www link to non-www link in .net mvc

It seems with the built in friendly routing library in .NET MVC, it would allow us to do something like this. In case it's not obvious what I want to with the built in stuff in .NET MVC, I want to a url starting with www to be automatically redirected to a non-www url using the MVC framework. ...

Question regarding an ASP.NET MVC form posting scenario

I currently have a user control that is used on both an /Address/Edit and an /Address/Create page. This user control simply has the following code in it to submit a new address to the system: <% using (Html.BeginForm()) { %> <table> <tr> <td>Street Address</td> <td> ...

How to create a dashboard user interface using ASP.NET MVC?

I am currently building an application using ASP.NET MVC. The data entry pages are fairly easy to code, I just make the Model for the page of the type of my business object: namespace MyNameSpace.Web.Views.ProjectEdit { public partial class MyView : ViewPage<Project> { } } Where I am struggling is figuring out the best wa...

How to allow authorization to an rss feed using ASP.NET MVC?

Our shop is in the process of converting our internal project management application from ASP.NET Web Forms to ASP.NET MVC. I would like to provide an RSS feed for our customers of their current open issues ... but I would like to do so with some type of authorization, e.g. login and a password. Is this possible using ASP.NET MVC o...

Creating new ASP.Net MVC project - Unit Test Dialog does not show up

When I create a New Project of type ASP.Net MVC Web Application, I expect the dialog for unit test applications to show up, but it does not. I cannot find the Unit Test App among the product types I can create either. How do I set up my VS so that the dialog shows up? I have installed Visual Studio 2008, .Net Framework 3.5 SP1 and ASP.N...

URL Design for SSL-Secured SaaS Application

I am developing an application using the ASP.NET MVC platform, which will be exposed as a service over the web (the SaaS model). I am trying to determine the best way to partition the URL namespace for each user account. The application will need to be accessed securely via SSL, so my main concerns have been around coming up with a URL...

Route to get all requests that look like www.example.com/asdf234 (no trailing slash allowed)

Hi, I want to catch all URL's in the root folder of the url www.example.com The url cannot end in a trailing slash, and can't contain any slashes at all. so these should pass: www.example.com/abc www.example.com/abc123-asdf www.example.com/abc123/ ** fail! www.example.com/asdfsd/asdf ** FAIL! ...

How does ASP.NET MVC communicate w/ an AJAX enabled webpage?

How does the data go from the MVC to the browser and back again? Does it use Microsoft's own technology like ASMX or WCF or something completely different? This sounds like MVC is using a ASMX Web Service they are using but I can't seem to find any documentation which gives the real answer. ...

ASP.NET MVC - User Input and Service/Repository - Where to do Validation?

This might be too opinionated a question, but looking for help! I have been trying to refine my ASP.NET MVC program structure. I just started using it at preview 5 and it is my first foray into business application development -- so everyting is new! At the controller level, I have a service object responsible for talking to the repos...

How to pass an unpersisted modified object from view back to controller without a form?

Short: how does modelbinding pass objects from view to controller? Long: First, based on the parameters given by the user through a search form, some objects are retrieved from the database. These objects are given meta data that are visible(but not defining) to the customer (e.g: naming and pricing of the objects differ from region to ...

Modelbinding with SelectList

I create a DropDown with the Html.DropDownList(string NameSelectListInViewData) method. This generates a valid Select input with the correct values. And all is well. Upon submit however, the value in the source SelectList is not bound. Case: ViewData.SearchBag.FamilyCodes: public SelectList FamilyCodes { get; set; } Html that gene...

What resources, outside of the Microsoft site(s), are available for learning about Form and MVC web applications?

I've found a few pages (some that even link to a number of other pages) on the Microsoft website that I bookmarked last night for reading today, but I'm curious as to other good non-Microsoft resources for discussing ASP.NET web applications, both Forms and MVC (including comparisons/contrasts between the two). ...

MVC Dynamic Routes

I would like to create dynamic urls that route to controller actions with an Id value. I've created the following route using a catch-all parameter routes.MapRoute( "RouteName", "{id}/{*Url}", new { controller = "Controller", action = "Action", id = "" ...

How do you stub out User.Identity.Name in ASP.NET MVC?

I'm trying to unit test a page in my ASP.NET MVC application that, when posted to, will delete a user's item. I want to restrict this page so that it can only be posted to by the owner of said item. Originally, I wanted to just stick a quick check in the controller that checked if the HttpContext.Current.User.Identity.Name is equal to ...

Best way to implement deletion in ASP.NET MVC "gridview"?

Given an ASP.NET MVC view that generates a table of entries using a "for" loop, what is the best way to add a "delete" link for each of the table rows? My first intuition would be to use jQuery to make an AJAX call to delete the row, then refresh the table. It seems like there should be an easier way though. Maybe make the link perfor...

how to make a wizard with ASP.Net MVC

Our site has multiple "wizards" where various data is collected over several pages, and cannot be committed to the database until the last step. What is the best/correct way to make a wizard like this with ASP.Net MVC edit: My boss is now saying "no javascript" - any thoughts on how to get around that restriction? ...

Refresh table info using jQuery and ASP.NET MVC

I have a simple page that displays a user's email addresses in a table. I also have a textbox underneath the table and an "add" button. Currently, I am using a simple form post that is handled by a controller that will add the e-mail address to the database and reload the page. This works fine, but I'm looking to streamline the proces...

Is there a simple alternative to GetModelAttemptedValue in HtmlHelpers?

I'm trying to create some HtmlHelper extensions and ran into a bit of a roadblock trying to get my extension methods to use attempted values defined by the ViewData.ModelState. The HtmlHelper.GetModelAttemptedValue() method is marked internal and isn't available to my extension methods. Is there a simple alternative in MVC? ...

Problem mixing webforms into ASP.NET MVC application

I've been toying with the idea of taking an existing ASP.NET Webforms application and converting it to a hybrid so that going forward, we can do ASP.NET MVC. In order to do this, I created an ASP.NET MVC application and started copying some of the folders from the ASP.NET webforms projects that contain webforms. I'm having a problem bu...

Uploading Files with ASP.Net MVC - get name but no file stream, what am I doing wrong?

I have this form in my view: <!-- This has a bug right here--v Don't copy this without removing the extra i--> <form method="post" enctype="mulitipart/form-data" action="/Task/SaveFile"> <input type="file" id="FileBlob" name="FileBlob"/> <input type="submit" value="Save"/> <input type="button" value="Cancel" onclick="window.location....