ASP.NET MVC seems to be encouraging me to use hard-coded strings to refer to controllers and actions.
For example, in a controller:
return RedirectToAction("Index", "Home");
or, in a view:
Html.RenderPartial("Index", "Home");
I don't want…
I have put together a small example here just to replicate the problem.
I have a strongly typed partial view _Name.cshtml:
@model ValidationInPartial.ViewModels.MyViewModel
Well i see this 2 properties but i cant understand the difference between them?
I cant seem to find any help anywhere about the PageData propriety.
so can any body help?
@
{
Viewdata["something"] = 1;
PageData["something"] = 2;
}
thanks
I tried to check if the user is in role at Application_BeginRequest and Application_AuthenticateRequest with this code and it will not work. At BeginRequest the code is never hit and Authenticate it's hit with some of the request and the profiler…
I enjoy working with ASP.NET MVC 3 using the Razor view engine, but am embarrassed to admit that not having the ability to preview the pages (.cshtml) in the Visual Studio designer negatively affects my productivity.
Is there a fundamental reason…
I'm new to Orchard, so I probably have no idea what I'm doing.
I've figured out how to override different shapes but putting a cshtml file in the View folder with the same name as the shape.
Also, I found the Menu and MenuItem shape cshtml files…
I am using ASP.NET MVC 3. I have a controller action that returns a PDF file like this:
Public Class ReportController
...
Function Generate(id As Integer) As ActionResult
...
Return File(output, "application/pdf",…
I have Visual Studio 2010 /SP1 / MVC 3 (With April Tools Update) installed on a machine with a fresh install of Windows 7 64-bit Professional.
I do not have resharper installed.
I never installed an RC or Beta of anything on this new OS Install.…
Hy!
My JS is requesting a JSON from controller to edit an existing object, a populated dropdownlist.
Then, the View send the actual values from my autosuggest dropdown, to lately the new value be compared to the old one and the new values be…
When coding up Ajax calls in ASP.Net MVC we have a lot of options as far as issuing calls, handling them on the server, and dealing with successes and failures on the client. Some things clearly have a correct answer, but I've been unable to find…
I have a table with money field in my database. I have created entity and created decimal property for that money field. When the value of that field is displayed on My MVC3 view, It has four zeros 0000 after decimal like this : 5489.0000. I want to…
I have the following problem: one of the system I'm working in most important features is a search page. In this page I have some options, like records per page, starting date, ending date, and the problematic one: type. One must have the…
I've gotten lucky enough to work on a completely new enterprise MVC 3 project. And by new, I mean source control is literally empty at this point.
We're trying to figure out how to lay out out the solution and various projects that will be…
I have implemented a file upload for images using ASP.NET Mvc 3 and the Microsoft.Web.Helpers NuGet package. The implementation is quit simple as it allows you to browse for a file and upload it to a specified directory.
Here is what I have for my…
I would like to know what is the easiest way to have a "Greater Than" & "Lower Than" validation on a ASP.NET MVC 3 form?
I use unobtrusive JavaScript for client validation.
I have two DateTime properties (StartDate & EndDate) and I need a validation…