I want to store a user's current location on an ASP.NET MVC website for the duration of a session. Because I want to use the location server-side, the way I think this should work (maybe other suggestions?) is that when a user first hits the website, I get the location and store it in the session, so on later requests it does not have to...
When creating a new MVC Project in VS2008 Professional (SP1 installed), I do not get prompted for a Unit Test project.
I have searched and found this solution (http://stackoverflow.com/questions/294117/creating-new-asp-net-mvc-project-unit-test-dialog-does-not-show-up) BUT I have already installed the Testing Tools and still no Unit Tes...
I'm having a weird issue where ViewContext.RouteData.Values["action"] is null on my staging server, but works fine on my dev machine (asp.net development server).
The code is simple:
public string CheckActiveClass(string actionName)
{
string text = "";
if (ViewContext.RouteData.Values["action"].ToString() == actionN...
About 10 stackoverflow.com podcasts back Jeff mentioned that instead of wiring up his routes inside of the global.asax file he instead put them inside his controllers near the actions those routes would invoke.
How does one go about doing this?
Doesn't a route have to be registered before the controller it routes to is hit? Does he ...
Hello, I wondered if there is an easy way (sample?) to re-POST an incoming form collection to a different server.
The reason: I have server 1 which has a form with a bunch of fields, but they actually need to be stored on server 2. I can't allow people access to server 2 though, so I need to ask for the input on server 1. I'd still like...
Our web application needs one common parameter in every action method.
In our case it is the customer account id and we need to support the following scenarios
a. A group of users might have the same account id which can be derived from the user profile.
b. Customer Support team should be able explicitly supply the account id of a cu...
When I'm in Visual Studio 2008 with an ASP.NET MVC project running, I can't seem to add an ADO.NET Entity Data Model to my project, it doesn't show up in the list of available things to add under the "Data" category.
I've made sure I'm running VS2008 SP1 and have .NET 3.5 SP1 installed. Am I missing anything? Other thoughts?
Thanks s...
Where should validation reside when using ViewModels with MVC (MVVM), on the Model or the ViewModel? (Or both or neither)? And why? I bring this up especially in light of V2 of ASP.NET MVC coming out soon.
What about complex/custom validation?
...
This is the control builder class...
public class ControlBuilder
{
/// <summary>
/// Html Control class for controlbuilder Control .
/// </summary>
protected HTMLControl formControl;
/// <summary>
/// Html Control class for the label.
/// </summary>
private HTMLControl labelControl;
/// <summary>
...
are there any high level best practices when doing this conversion?
...
i am migrating a site over to asp.net from an asp.net site and one of the pages has a datalist as below:
<asp:DataList ID="MyDataList" runat="server" BackColor="#EEEEEE" CellPadding="10"
ItemStyle-HorizontalAlign="Center" GridLines="Both" Width="750" RepeatDirection="Horizontal"
RepeatColumns="4" RepeatLayout="Table" ItemStyle-...
Hello
I have a view where I'm going to list a checkbox-list (helper), and I'm not sure howto call that, since it always says my "type" is wrong.
I'm trying to call:
public static string CheckBoxList(this HtmlHelper htmlhelper, IEnumerable<string> values, IEnumerable<string> labels, string name)
{
return CheckBoxList(htmlhe...
We are building an ASP.NET MVC site, and I'm struggling with where to define a connection to best enable unit testing (I use 'connection' generically - it could be a session, a connection, an adapter, or any other type of data context that can manage transactions and database operations).
Let's say we have 3 classes:
UserController
U...
I have a UserControl that I call with Html.RenderAction(...), so far so good..
Then I want to specify in the user control, which action should be used
Html.BeginForm("DeleteComment", "Comments", new { Id = "frmDelete" }, FormMethod.Post);%>
<%= Html.SubmitImage( "imgbtnDelete", "/image.png", new { ... })%>
<% Html.EndForm(); %>
And...
i have an asp.net website where i do paging through on the code behind using:
PagedDataSource objPds = new PagedDataSource
{
DataSource = ds.Tables[0].DefaultView,
AllowPaging = true,
PageSize = 12
...
Hello
I managed to get a checkboxlist working, and I can't somehow get the values back when I post the "usual way". Must I use Request.Form and loop them into the model before updating the database?
"userobj" has it's userobj.UsersUsergroups count = 0 on post.
control:
[AcceptVerbs(HttpVerbs.Post)]
public ActionResult Use...
I have what seems to be a strange problem to me. I am working on creating an ASP.NET MVC project and when I load the site using the 'Visual Studio Development Server', everything works as expected. However, if I change the project properties to 'use local IIS Web Server' and load the site, only the Home Page works. If I try to load an...
I'm trying to dynamically load partial views into a view by passing the list of paths for the partial views I want and then calling RenderPartial on each. This seems to do the trick. The problem comes in when I try to pass the model to the partial view. Since I'm dynamically loading them, I don't exactly know which model to pass for t...
I have got an app I'm writing and I'm currently considering using MVC to develop it. I have used MVC quite a few years ago under J2EE, so I have some familiarity with the framework, but I want to review how it is implemented under ASP.NET before I go ahead with it. I have done some prototyping using webforms and have written some quite...
If you have a select list set to multiple in ASP.NET MVC, how does the modelbinding work?
What does it return for your selected items, an array?
<SELECT NAME="toppings" MULTIPLE SIZE=5>
<option value="mushrooms">mushrooms</option>
<option value="greenpeppers">green peppers</option>
<option value="onions">onions</option>
...