I'm attempting to use jqGrid in my ASP.Net MVC application and have a requirement that some columns arre editable in the Add dialog but not the Edit dialog. Apparently the way to do this is to use the beforeShowForm javascript event and set the properties on the particular input field.
So far I can't manage to get the beforeShowForm eve...
I am attempting to bind a list that is part of a larger view model without resorting to a custom model binder. When I use an editor template to build the list of inputs, the generated names are not in the correct format for the default binder to work.
Instead of Items[3].Id like I would expect it is Items.[3].Id. If I build the list wi...
I'm trying to find an example of how to convert the standard login framework that ships with ASP .NET MVC 2 (the account controllers and views, etc) into a modal login dialog system, like the one at Digg.
After searching for hours, the closest tutorial I found was this: http://www.weirdlover.com/2010/05/20/mvc-render-partial-modal-pop...
For my ASP.NET MVC app, I just find dealing with unique-identifiers harder, so I have added my own field to ASPNET_USERS table - UserIdInt (which is actually a bigint!) So most of user operations use userIdInt as reference.
Anyway, I am debating between two approaches:
1)When a user logs in, look up from the database and store the user...
I have a question regarding Model Binding in MVC
Say I have a simple POCO like below.
public class Person
{
public Title Title { get; set; }
public string FirstName { get; set; }
public string LastName { get; set; }
public bool LeadPassenger { get; set; }
}
I have a controller that passes a collection of Persons to a ...
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 have an abstract parent class called Quotation, with children MotorQuotation and PropertyQuotation. I am trying to use one controller (QuotationsController) to handle the Quotation hierarchy.
How would this be implemented in ASP.NET MVC?
Note: Would it be better to use composition?
Edit: For instance, one question that could come up...
I have the following model and view, and I would very much like to accept date values in the format 'dd/MM/yyyy'. However, despite using the DisplayFormat annotation, I still get a validation error using my chosen format.
[MetadataType(typeof(MilestoneMetadata))]
public partial class Milestone {
public class MilestoneMetadata {...
Hi folks!
There is a common issue to write strongly-typed Html helpers.
The problem is how to retrieve property name/value pair.
Assume we have following Html helper declaration:
public static string DatePickerFor<TModel>(this HtmlHelper<TModel> helper, Expression<Func<TModel, DateTime?>> expression)
There are several solutions I fou...
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...
I've got a real cheesy counter, just adds one to the counter field when a visit hits it. It's not counting page hits, but it's still cheesy.
What I need to do is stop someone from just hitting refresh over and over. What's the simplest was to get this done? Cookies?
I'd prefer not to log every visitor's ip address, etc... something sim...
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 ...
Hi everyone, another ASP.NET MVC question.
Assume the following scenario. You have three controllers:
getFirstData
getSecondData
useFirstData
The workflow of your site requires that the user first uses the getFirstData controller, and inputs some data (lets say an int) in the view.
I then need to use the second controller (getSecon...
When implementing ASP.NET MVC AsyncController the xxxCompleted method has to be Public. I'm wondering if this means the xxxCompleted method can be invoked directly, or if this is protected internally using NonAction or something similar?
Thanks.
...
I recently noticed that I had a big hole in my application because I had done something like:
<input type="text" value="<%= value%>" />
I know that I should have used Html.Encode, but is there any way to do that for all values, without having to do it explicitly?
...
Can somebody tell me more details about it?
...
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...
Hi.
I find this article:
http://blog.tomasjansson.com/2010/09/asp-net-mvc-helper-for-active-tab-in-tab-menu/
and i want to this :)
Unfortunately, I was an error:
Opis: Wystąpił błąd w czasie
kompilowania zasobu wymaganego do
obsłużenia tego żądania. Przejrzyj
poniższe szczegłowe informacje o
błędzie i zmodyfikuj odpowiedni...
Why do I have to add /Content/ to the uri when using Url.Content? What's the method useful for? :) Am I missing something?
<link rel="stylesheet" type="text/css" href="<%= Url.Content("~/Content/StyleSheets/screen.css") %>" media="screen" />
...
I use a post-redirect-get (PRG) pattern to save an entity in ASP.Net MVC 2. The controller methods are 'Save' (inserts or updates database) and 'Edit' (retrieves user input). In 'Save', I do modification check before saving by checking a 'version' column of the entity. If someone else has modified the entity, the 'version' column will no...