I have an Ajax.Actionlink that fires to a method that is placed inside my controller which returns a list of users and renders a partial view.
[Authorize]
public ActionResult UsersAddresses()
{
...
...
return PartialView("AddressesList",users);
}
Is there any way how I can render two or more partial views at the same t...
The latest MVC release contains some type safe html helper extension methods, for example, CheckBoxFor() and LabelFor() does anyone know if there is a particular reason why they haven't implemented a CheckBoxFor()?
...
My problem is pretty simple. I've got a Uri and I want to figure out which route it maps to so I can do some checks on the various pieces of the route: controller, action, etc.
How do I go from Uri to RouteData or Route?
...
I'm getting some very strange behaviour with tinyMCE in an ASP.NET MVC 2 beta app (same happend with MVC 1). I have a view called "edit.aspx" that is called when the user tries to create or edit an entity. The view uses jquery to load tinyMCE where ever it finds textarea's.
Here are my 2 action methods that both call the same "edit.asp...
How is formatted user input typically handled in an MVC application? A user entering "1,000.00" for a number for example. I'm somewhat surprised the default ModelBinder does not pick up on this. Would this be the type of thing I would create my own ModelBinder for?
...
Since the validation summary just displays the modelstate errors in a html list, does this mean that I can have only one validation summary? Or is there a way I can associate some kind of context to say that these modelstate errors show up on this summary and these go to the other?
...
I've created an MVC application and I've set up Roger Martin's sqlite Providers in place of the default Providers. I'm curious about how I would go about unit testing these.
Below is a stripped down method that has many validations, only one of which is still present. Among other things, I want to write tests that ensures one can't ...
I have an Asp.Net MVC page that links out to a Asp.net web form with a report viewer control on it. The web form opens in a new window, and displays a report properly when clicking on the link on my MVC page. However when I close the my broswer window while the report is processing, and try to open it again, the page hangs and eventual...
Is JQuery more suited to MVC than WebForms or it doesn't matter?
I am planning to use JQuery heavily.
...
I get this error when I invoke the Edit Action of one of my controllers.
Here is the C# code of the Edit action method
[AcceptVerbs(HttpVerbs.Post)]
public ActionResult Edit(cedetails detailToEdit)
{
validateDetail(detailToEdit);
if (!ModelState.IsValid)
return View();
try
{
...
Hello,
I've been running an ASP.NET MVC application on my IIS 7.5 localhost (on my Win7 Pro box) server with SQL Server 2005 Developer Edition.
I went to put the application on my production server (IIS 7, SQL Server 2008) and am getting SQL Server connection errors. Here is the error I get when I try to browse site root:
A network-...
i have a form that i am submitting to my controller. I created a data class that is used to pass into my controller to do something like this:
[AcceptVerbs(HttpVerbs.Post)]
public ActionResult Update(ApplicationUpdater applicationUpdater_)
{
}
the issue is i used to have a list in a multi select dropdown and that simp...
I have an action in which I want to intercept any possible integer id that comes and place it behind a hash. (I have some Javascript that is handling the id). I am only doing this extra step for the sake of URL-hackers like me who might forget my convention of putting a hash before the id.
Here is my action:
public ActionResult Edit(in...
i see there are solutions using different model binders like castl but i didn't know if the basic default model binder supported nested complex objects when i am posting a form to a controller.
...
Any help would be great please! I'm importing Google contacts by CSV. The problem is I can get the value of only specific header of the CSV file as I mentioned in the code. Can anyone get me the source code to get the entire set while importing the Google CSV file?
private void GoogleCsv()
{
StreamReader Sr = new StreamReader(Server...
I'm looking for a form validation framework that works best in both Windows (WPF using MVP) and Web (ASP.NET MVC).
I'm currently looking at three choices:
Enterprise Library Validation Application Block
http://www.codeplex.com/FluentValidation
http://validationframework.codeplex.com
I like Fluent Validation as it looks a lot cleaner...
In my App i when debuging a have this exception:
{"Operation could destabilize the runtime."} in the foreach loop:
foreach (var item in Model)
when i hover the model in debugmode the first time
i says :
ResultView=>Expending the result view will enumarate the enumarable
base=>Operation Could not destabilize the runtime...
I want to verify the type of the uploaded file,
that's how I do it:
[AcceptVerbs(HttpVerbs.Post)]
public ViewResult GetDataFromFile()
{
var file = Request.Files.Get(0);
...
if (file.ContentType != "text/csv")
{
ModelState.AddModelError("FileInput.File", "The file uplo...
Does installing ASP.NET MVC require a server reboot?
I've set up quite a few ASP.NET MVC sites on production servers in my time, but today, I'm deploying to a server without MVC installed for the first time.
So, I installed the latest MVC release, restarted the IIS and went through the usual hoops to set up a MVC website on IIS6 (aspne...
First we have the form:
<link href="../../../content/somecontent" />
This is annoying to figure out (need to count path depth one by one) and the most prone to mistakes. Someone came up with this:
<link runat="server" href="~/content/somecontent" />
This is easier but I don't know how casual I can be using that solution. Can it be ...