asp.net-mvc

MVC.NET in VB - Select List to Html.Dropdownlist

Seems most of the examples I find are c#, so in some cases I'm left scratching my head... to make a long story short, I'm simply trying to output the selectList of items to a drop-down within my view: My ViewModel: Imports System.Web Imports Whitebox.UI Namespace ViewModels Public Class TFS_VModel Public Property AccType() As IEn...

MVC2 ValidationMessage in template.master not rendering

I implemented the template.master technique described by Brad Wilson in this posting but I changed line 31 of his EditorTemplates/Template.master from: <%= Html.ValidationMessage("", "*") %> to: <%= Html.ValidationMessage(ViewData.ModelMetadata.PropertyName)%> so that the actual validation text will be displayed next to the control...

jQuery validate required method and textboxes with 0

I've got a form with two sections. Each section expands by its own radio button, so there's only one visible section at a time. And I use ASP.NET MVC HtmlHelper to generate fields like so: <label for="type-permanent" class="radio active"> <input type="radio" name="Type" value="Type1" id="type1" /> Label1 </label> <%= Html.TextBox("F...

ASP.Net MVC maintain state of a dynamic list of checkboxes

I have a class called "PropertyFeature" which simply contains PropertyFeatureID and Description. It's a proper model created through LINQ to SQL mapped to an SQL Server database table. An example instance/row would be: PropertyFeatureID: 2 Description: "Swimming Pool" The number of rows (PropertyFeatures) can of course grow and shrink ...

Adding a custom httpmodule to route to MVC or custom handler selectively.

I'm not sure if this has been asked already. Well, here is my problem. I have a classic Web Forms site that I'm trying to turn into hybrid-MVC. That is, all new functionality would be MVC. However, we have a custom HTTP handler that takes care of our darn-friendly URLs and which we are not planning on changing. My problem right now is a...

Content Indexer/Indexing Service - database content?

We've been using content indexer successfully for years to provide search. This works well because a significant amount of content is cached on disk. However, I'd like to move away from this paradigm. Is there anyway I can keep content indexer and have it index "pages" stored in SQL Server? ...

How do I pass model values as javascript function parameters from inside an asp.net mvc Html helper such a Html.Radio?

Okay, pretty simple question. I think I need to drop in some escape characters, but I'm not quite sure where. Here is the javascript function I'm attempting to call: function setData(associateValue, reviewDateValue) { var associate = document.getElementById("Associate"); var reviewDate = document.getElementById("ReviewDate"); ...

Alternatives to model binding for data submission

I have an ASP.NET MVC2 application that contains a partial view that allows the user to set a variety of properties on a collection of objects. These are currently done using HTML input controls such as the textbox and dropdown list. I am using using out-of-the-box model binding to submit the user-entered values to the server via a form ...

File Upload with progress bar in Asp.Net Mvc/ jQuery?

I am looking for a jQuery plugin for File upload with progress bar for Asp.Net MVC. We are using RadUpload control in an existing Asp.Net WebForm application and it shows the status without using Flash/Silverlight. http://demos.telerik.com/aspnet-ajax/upload/examples/customizingraduploadui/defaultcs.aspx?RadUrid=5154cf7e-2fee-4adc-b0cc...

Why can't I share Session state between 2 web apps with StateServer? What am I missing?

I'm having trouble getting 2 identical ASP.NET MVC applications to share the same Session using a Session StateServer. The reason I'm trying to do this is we will eventually be deploying this app across 3 web servers that need to share the same state. We need to use StateServer because we are trying to minimise use of the db for non data...

reject user to specific view ?

i have mvc2 project and i make custom role Provider I'm using attributes [Authorize(Roles = "Admin")] to prevent an authorized user from doing some actions that always reject user to log in view i want to change that and redirect user to view that I'm tilling him that he isn't authorized for this action [Authorize(Roles = "Admin")] ...

MVC.net exposing viewmodel static list to controller

I have a basic viewmodel list in VB: Transaction Status (Blackbox) Public Property TStatus() As IEnumerable(Of SelectListItem) Get Return t_status End Get Set(ByVal value As IEnumerable(Of SelectListItem)) t_status = value End Set End Property Public Sub New() ...

asp.net mvc 2 - Model Binding and Select Lists

I have the following select list: <select d="Owner_Id" name="Owner.Id"> <option value="">[Select Owner]</option> <option value="1">Owner 1</option> <option value="2">Owner 2</option> <option value="3">Owner 3</option> </select> It gets bound to: public class Part { // ...other part properties... public Owner O...

UpdateModel not working on references to an object in the view model

Hi All, I'm using UpdateModel(<model>, new[] {"Customer.Name", "FirstName", "etc..." }) Customer.Name is an property of Customer object which resides in a view model. When I post the form I'm seeing that values are being posted as expected. When I get to the UpdateModel part the FirstName value is there but Customer.Name is not. A...

Is it acceptable to have unhandled exceptions in ASP.NET web applications?

I'm working with a third party vendor at the moment who has supplied an ASP.Net web application. The web app generates around 200 unhandled exceptions per day, which end up as emails in my in-box. Upon investigation it turns out that most of these errors are triggered by the GoogleBot web crawler indexing the site and triggering access t...

How should I design a shared Module that is needed in 2 different ASP.NET MVC Applications?

I'm designing a Module that is to be consumed by two distinct WebSites. Everything will be written in MVC (the module and both web applications). I would like to design my module so that the code can be included from a shared location. I only want to maintain a single version. My first thought was the Area feature of MVC 2. But from...

Input file autobind to byte[] aray in ASP.NET MVC

Anyone managed to get default binder to work with input file control and property of type byte array? If I have a property on my ViewModel named Image and a file input control on my view name Image, default binder issue this error: The input is not a valid Base-64 string as it contains a non-base 64 character, more than two padding cha...

Personalized URL for each user using ASP.NET MVC

I'd like to create a site where each user has his own home page and where the URL is in the format site\username. How can I accomplish this with ASP.NET MVC routing system? I'm planning the follow URL layout: mysite/ -> home page mysite/account/register -> account register page mysite/user1 -> user1 home page mysite/user2 -> u...

Asp.net mvc app on a shared host move to Windows Azure during peak load possible?

I have an ASP.NET MVC web application that is hosted on a shared hosting account. The site has no issues during regular usage. However the nature of the business is such that for one week out of the month we have very very high traffic. During these high traffic peak load times, my application has several "Service Unavailable". One of ...

How to handle splitted date fields (year, month, day) in ASP.NET MVC

In need splitted date fields for dob (like the facebook registration form) in my current project. I currently have a working solution but this solutions seems a little bit "dirty". My solution is a DTO for the splitted date and an editor template for this type. public class SplittedDate { public int Day { get; set; } ...