i have a colModel looks like this:
{ name: 'TypeId', index: 'TypeId', align: 'left',
width: 50, editable: true, edittype: "select", sortable: false,
hidden: false, jsonmap: 'InspectionTypeId' },
how can i change the cells text not changing the value?
...
I want to write a modelbinder for ASP.NET MVC that will correct values that will be visible to the user. Maybe it will capitalize the initial letter of a value, trim strings, etc. etc.
I'd like to encapsulate this behavior within a modelbinder.
For instance here is a TrimModelBinder to trim strings. (taken from here)
public class Tri...
I need to do with HtmlHelper in Controller, so how i create it in Controller (asp.net mvc 2.0)?
...
I am about to start building a ASP.NET MVC web application that relies on a database as it's backend (big surprise).
As a student, I have access (via Dreamspark) to SQL Server 2008 Developer Edition, and with the default VS 2008 install, I have SQL Server Express 2005 installed already.
Many of the examples on MVC I have seen use a loc...
I have installed the ASP.NET MVC 2 RC and opened the default "example project", but get the following error:
Parser Error Message: The type
'System.Web.Mvc.ViewMasterPage' is
ambiguous: it could come from assembly
'C:\WINDOWS\assembly\GAC_MSIL\System.Web.Mvc\2.0.0.0__31bf3856ad364e35\System.Web.Mvc.dll' or from assembly 'C:\Doc...
#Html.RenderPartial(MVC.Shared.Views._Sorter);
throws error =>
There is no build provider registered for the extension '.spark'. You can register one in the section in machine.config or web.config. Make sure is has a BuildProviderAppliesToAttribute attribute which includes the value 'Web' or 'All'.
Description: An unhandled ...
In asp.net mvc2, what's the difference between
Html.Action(...)
and
Html.RenderAction(...)
?
...
Hi all,
It seems recently that all I ever seem to post about is ASP.NET MVC with JSON - you would think I'd learn by now! However, strange things keep happening that I can't explain!
I have a Controller method that returns a JsonResult:
public JsonResult GetAllUserTasksForStage(int StageID, string Username)
{
var uM = ManagerProvi...
The new Asp.net mvc 2.0 input validation works like a charm, except for decimal seperators when it comes to jquery.validate. When I use the Microsoft MVC ajax libs it works fine. The comma is the decimal seperator server side as well as client side.
<script src="/Scripts/MicrosoftAjax.js" type="text/javascript" ></script>
<script src="/...
If I have a strongly typed view e.g. Inherits="System.Web.Mvc.ViewPage>" %>
And i want to output the list of items in the model, when I use "Add view" within visual studio i get the following html code generated below.
Is there anyway to eliminate the Magic string "Version" when outputting the table column headers?
<table>
<tr>
...
I have an HtmlHelper extension that currently returns a string using a string builder and a fair amount of complex logic. I now want to add something extra to it that is taken from a render partial call, something like this ...
public static string MyHelper(this HtmlHelper helper)
{
StringBuilder builder = new StringBuilder();
...
I'm trying to build a hit counter for different parts of the website in ASP.NET MVC - any idea where the best place to do this would be, or a good way to do it? We're wanting to track how many hits individual parts of the website get.
...
I have a small web app (Mvc) that I need to periodically update (no ftp or other access).
I would like that from the "Super Ultra Mega administratior" page direcly in the app I can spin up the update process.
I know this is not the best security approach but I can live with it and I would like to avoid a permanent service that continuo...
The model validation doesn't evaluates the attributes linked to listbox values if you don't select at least one of them.
This way is not possible to do a model evaluation using DataAnnotations in order to inform required values.
The controller:
using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using S...
how to detect when a page is called using ajax in asp.net mvc ?
...
I have a MVC.NET application with one route as follows:
routes.MapRoute("member", "member/{id}/{*name}", new { controller = "member", action = "Details", id = "" }, new { id = @"\d+" });
Thus, a link could be something like this: http://domain/member/123/any_kind_of_username
This works fine in general but if the path contains illegal ...
i have an asp.net mvc website where i build up most of the page using C# for example building up html tables given a set of data from my viewmodel
i also have a lot of javascript that then dynamcially modifies these tables (add row for example).
the javascript code to add a new row looks extremely similar to my "rendering" code i have ...
i keep hearing that i shouldn't be using primary keys in my asp.net mvc url
for example: /Users/Edit/1243
what is the issue here?
what is the alternative, putting in user names? as you want it to be unique, it seems like primary key is the cleanest option
thoughts?
...
I'd like to see the SO's community response to this. I understand that a ViewModel is basically used to bind the view with data. When a form submits, should the object that be returned (modelbinded) be a ViewModel or an entity? I know a ViewModel IS an entity but I'm talking theoretically here. I want to make sure that myself and my ...
I am trying to format a date rendered by ASP.Net MVC's TextBoxFor using the value of a strongly typed view. The date is nullable so if it is null I want to see a blank value, otherwise I want to see it in the format MM/dd/yyyy.
<%= Html.TextBoxFor(model => model.BirthDate, new { style = "width: 75px;" })%>
Thanks,
Paul Speranza
...