Greeting Everyone,
I'm having a little trouble with a partial view I'm using as an edit form. Aside from the hidden elements in the form, the model is null when passed to my EditContact post controller.
I should add, I realize there's a more seamless way to do what I'm doing using AJAX, but I think if I can solve the clunky way first ...
I'm using the following code:
<form action="" method="post" enctype="multipart/form-data">
<label for="file">Filename:</label>
<input type="file" name="file" id="file" />
<input type="submit" />
</form>
And...
[HttpPost]
public ActionResult Index(HttpPostedFileBase file) {
if (file.ContentLength > 0) {
var fileName = P...
I need to start worrying about user input. I notice the htmlhelper class doesnt do a great job of this. Can anyone suggest a nice framework for input sanitization? I'm using asp.net mvc2.
...
Hi,
The custom (editor) templates in ASP.NET MVC 2 make it possible to create re-usable UI components (such as a selectlist, radio button list). Even ajax components are possible.
Is there some website where developers can share their custom templates with each other? It seems a bit redudant to write these basic components by my own i...
Hi All,
I've got an MVC web application that is used as an interface to a Console based app that exposes a bunch of ServiceHost/s using the net.pipe protocol.
I would like to use the asp.net membership/role/profile provider to manage my users and their roles and profile information (Inside the Console Application). I've done this in q...
How can I tell the viewengine to look for editortemplates in another area that is in another web project?
...
Here's what i'm trying to do: 1 textbox with an Add button, and a ListBox underneath with a Delete button, along with a bunch of other fields. You can probably guess the functionality: type something in the text box and click Add, it will add that string into the listbox below. Select an item in the listbox and hit Delete, the item is ...
Hey guys, It's 5 am here, I was doing some code... when this came out:
public interface IViewModel { }
public interface IToViewModel<T> where T : IViewModel { }
public static class MvcExtensions
{
public static T ToViewModel<T>(this IToViewModel<T> self)
where T : IViewModel
{
var instance = Activator.CreateIns...
I am trying to customize the delete function in jqGrid.
I have enabled the delete button on the grid
$("#myGrid").jqGrid('navGrid', '#pager',
{ add: true, addtitle: 'Add Customer',
edit: true, edittitle: 'Edit Customer',
del: true, deltitle: 'Delete Customer',
refresh: true, refreshtitle: 'Refresh data',
...
I am trying to create a RenderAction method on the Master page that will dynamically generate a side bar based on the current controller and action. When the RenderAction is called in the view it is populated with the controller and action of that particular RenderAction Method. For Example, if I am on the controller of “Home” and acti...
In an article titled Inegrating jQueryUI with MVC is this code snippet:
<li><%= Html.ActionLink("Home", "Index", "Home",
new { title="Home Page" }, null)%></li>
I think the article pre-dates MVC2 release and that might be why i get a syntax errors at the opening brace:
Type or 'With' expected.
thx
...
I have a controller with an action that has a parameter (JobID). I was surprised to see that it automatically mapped to a hidden field with the same name in the view that the controller returned. I am using strongly typed view models and assumed I needed to pass all model properties as part of the view model. It appears that this is not ...
We have an ASP.NET MVC2 web application. For reasons outside the scope of this issue we decided to use the classic session state in the application. Following features are implemented in it related to session.
Session_Start event handler in global.asax stores a variable in session. This is in relation to a workaround to detect session ...
If i have N numbers of classes on each of them i am declaring for example property which contains some app setting values from config file.
public static IAppSettings AppSettings { get; set; }
I want to populate this property automatically when class is created.
I am thinking to achieve this goal using StructureMap.
I want to "sa...
I am using free Telerik.Web.Mvc grid and following this example: http://demos.telerik.com/aspnet-mvc/grid/hierarchyajax
My Issue:
I am populating the grid with search results after user input some data and submit with a search button
In the DetailView() method I reference my 'SearchQuote_QuotesForHierarchyAjax' method, which is in defi...
I'm trying to setup data annotation validation for an object in my model and it has a special need. I have to essentially take some extra properties that I'm adding and combine them to get the value of a real property. For example I have a base object:
Task {
public DateTime? Due
}
But my form has the fields of:
Task.DueDate
Task...
I am banging my head against this wall for some time, some help will be highly appreciated:
Let's say I we have a simple Model:
public class Contact {
public string FirstName { get; set; }
public string LastName { get; set; }
}
And a simple editor temple:
<%@ Control Language="C#" Inherits="System.Web.Mvc.ViewUserControl<Rpd...
Hi,
in asp.net mvc 2 or beta , model not accepting the date 13 ( more than 12'th of date) . Model showing error ads
" The value '20/10/2010' is not valid for MyDateFieldName "
what have to do ? Model showing false status as ModelState=False. why ?
...
Is there a validation failed or similar event raised by the MicrosoftMvcValidation.js framework and if so how do I go about hooking into it ?
Currently I have a "global" function that displays a progressing overlay on submit of a form but when validation fails I have no way of removing this ....
...
Hi,
I am working on a small CMS for fun and as part of this I register routes from a database at app start. It is possible for a user to add a route themselves. The problem is that this route is stored in the db and so isn't registered until app restart.
Is it possible to re-register routes without an app restart?
If not, how do I res...