Hi all!
I've faced the following problem. I'm developing a form for the site and this form should have validation. I wanna to use native ASP.NET MVC 2 validation functionality but get stubborn with it. I have a form that is loaded via $.get and displayed using jQuery UI modal dialog. All examples I found explains how to use MVC validati...
I have MVC 2 site, and I.E is cacheing word documents linked on my site. I know there is a way to clear cache before every action in the controller. But for these links i am not using action, i am just creating regular href links.. Is there anyway i can clear the cache?
...
I have an area setup in MVC2, called Admin/, which I want I only want Users who belong to the role "admins" to have access. I know I can decorate each of the methods with [Authorize(Roles="admins")], but this seems tedious when your talking about multiple controllers with multiple actions.
Is there an better and cleaner way?
...
Hi everybody,
I'm just starting with ASP.Net MVC 2 and might be doing something wrong. I have a controller who builds some objects and passes them to a view using ViewData. In the view I display the data etc ... and then want to submit the same data (plus other user input) back to the same controller. Is there any simple way to do this ...
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");
...
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 ...
Hello. I am learning asp.net mvc 2 and fluent validation. My setup is shown after the text here. My problem is i do not know how to set the errors contained in the res object on the view page in a nice way. How should this be done? As it is now no errors are displayed on the view, but the validation is working quite well. I suspect i hav...
I have run into a strange, I assume, bug when working with ViewModels and exceptions. On a view that uses a standard model with nothing but primitive types I will do something like this in the controller if there is an exception:
ModelState.AddModelError("AdminError", ex);
Then on my view I have something like this:
<%= Html.Valid...
Can anyone tell me how to use DataType.Custom in ASP.NET MVC 2?
...
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()
...
I am trying:
<%= Html.ActionLink("Link Label", "Index", "controller_name", new { area = "AreaName" }, new { @id = "documentation" })%>
To create the appropriate html to send the user to the "documentation" part of the web page by rendering the id into the title (i.e. ) and then dropping the "#documentation" onto the end of the url lik...
Hey
I'm trying to create a strongly type html helper extension for a date picker using jquery ui datepicker. I have created an extension that isn't strongly typed, which works but now I'm trying to create it strongly typed.
Here is what I have:
public static MvcHtmlString DatePicker(this HtmlHelper html, string name, object date)
...
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...
Hi all,
I'm using asp.net mvc-2 and would like to know if there's a way to create a listbox with a checkboxlist inside of it?
...
I've got a table that stores a True/False value as a sqlserver bit field (Featured). First, is there a better way to generate a dropdown list for this other than manually?
Second, here's what I've got so far which works but does not add selected="selected" to any items in the DDL.
Edit 1: I've updated this example according to the ans...
/Controllers/ViewModels?
/Views/ViewModels?
Other?
...
Does anyone have suggestions for best practices using "review" pages and dropdown items?
(What I mean by "review" page is, they enter data and press submit, that goes to a "pass-through" action that renders a summary of what they entered and if they like it, they press submit and it posts to an action that takes it and stuff it.)
For ...
Hi
Is there a way of detecting when an AJAX request (using jQuery) to an ASP.NET MVC application redirects me to the login page?
I'm getting partial views rendered using an ajax call, but when the user has been signed out (for whatever reason), instead of returning a 302 or some other indication (that I can see) I get the login form re...
I am writing a website to consolidate a bunch of XML files with data into one MySQL database. I need to have a way to allow users to select a directory on their computer that contains a bunch of xml files. The site then reads each of those files and takes care of consolidating the information.
Is there a simple way (like the default ope...
Hi
I have some XML Serialization and it works on my local machine but when I put it up on my hosting company and try it out it fails.
I don't know why
Server Error in '/' Application.
Object reference not set to an instance of an object.
Description: An unhandled exception occurred during the execution of the current web request. Plea...