Can anyone point me in the right direction on how to map a route which requires two guids?
ie. http://blah.com/somecontroller/someaction/{firstGuid}/{secondGuid}
where both firstGuid and secondGuid are not optional and must be of type system.Guid?
Thanks
...
DataAnnotations does not work with buddy class. The following code always validate true. Why ?
var isValid = Validator.TryValidateObject(new Customer(), Context, results, true);
and here is the buddy class.
public partial class Customer
{
public string Name { get; set; }
public int Age { get; set; }
}
[MetadataType(typeo...
Long story short, the database I'm using needs to get looked at. Until that happens, I need to make due with what I've been given (I know, I should fix it..).
I have a table that get populated via an external text file. I am not sure of the exact process as I'm relatively new to the company.
The table does not have a primary key as t...
So here's the deal
I'm working on a project that I had originally focused on Zend Framework, But now I want to get into ASP.NET MVC and boy lets just say it's good and a great start though i'm still at the beginning stage of it. But I am having issues with passing Data From My Controller to the Master / Layout Page. Now in Zend I am ...
I am a big fan of optional parameters in C#4 but am having an issue with MVC when I use them in my controller constructors. For example, if I have a single constructor:
public TestController(sting a = "") { /* blah */ }
MVC has a fit saying that there are no parameterless constructors for TestController.
How can I get around this?
...
I have an ASP.NET MVC application where the default page should be index.html which is an actual file on disk.
I can browse to the file using www.mydomain.com/index.html so I know it will be served and exists but if I use www.mydomain.com I get a 404.
I have ensured that the default document is correctly set in IIS7 and I have even gon...
Let me first put the code snippets here. I am just using the ASP.NET MVC project Visual Studio creates out of the box. So I am just putting the snippets I added to it:
Site.master's head section:
<head runat="server">
<title><asp:ContentPlaceHolder ID="TitleContent" runat="server" /></title>
<script src="../../Scripts/jquery-1....
I have an ASP.NET MVC 2 app targeting .NET 4 that needs to be able to resize images on the fly and write them to the response.
I have code that does this and it works. I am using System.Drawing.dll.
However, I want to enhance my code so that not only am I resizing the image, but I am dropping it from 24bpp down to 4bit grayscale. I cou...
<% if (condition) { %>
<%= variable %>
<% } %>
or
<% if (condition) {
Response.write(variable);
} %>
...
I have a drop down menu in an ASPX page along the lines of:
<form>
<select name="cars">
<option value="volvo">Volvo</option>
<option value="saab">Saab</option>
<option value="fiat" selected="selected">Fiat</option>
<option value="audi">Audi</option>
</select>
</form>
That is dynamically generated from another controller (value...
I have a form with two submit buttons in my asp.net mvc (C#) application. When i click any submit button in Google Chrome, by default the value of submit button is the first submit button's value.
Here is the html:
<input type="submit" value="Send" name="SendEmail" />
<input type="submit" value="Save As Draft" name="SendEmail" />
<i...
i have a project say MyProject. It is an asp.net MVC project. In bin directory, i have deleted a DLL named MyProject.dll. Now when i try to build the project, i am getting following error.
The name MyProject does not exist in
the current context.
In my view files and controller, there are a lot of code like
MyProject.Models;
o...
Hi all,
I have a website where an ajax call will get some Json data from a Asp.Net-Mvc action.
Now I'm trying to do implant errorhandling in it.
But I'm stuck at the point how to do it.
The easyst way i found, was cattch the exceptions in the controller action, and Return a Json object with an error message in. And then in the ajax s...
I have an mvc application that has been coded to use Windows authentication and runs on an internal intranet. It validates users by matching user.identity.name to what is in the aspnet_users table, this is all good.
However, i have started creating an internet version to run on the web. All the existing default code for account.mvc/LogO...
Hello all,
Recently I've switched to Ninject 2.0 release and started getting the following error:
Error occured: Error activating SomeController
More than one matching bindings are available.
Activation path:
1) Request for SomeController
Suggestions:
1) Ensure that you have defined a binding for SomeController only once.
Howev...
Is there a way to call automaticliy an action from aspx or ascx on asp.net mvc.1.0
Think like a redirection.
...
I have the following code, that in my head should create a new row in a table:
Dim fin As Boolean
Dim db2 As New ChecklistModeldbmlDataContext
For Each a In bServers
If collection("fin" & a.ServerName) = "true, false" Or collection("fin" & a.ServerName) = "true,false" Then
fin = True
Else
fin = False
End If
b...
is it allowed in ASP.NET MVC to alter the submitted values?
[HttpPost]
public ActionResult Create(Person toCreate)
{
toCreate.Lastname = toCreate.Lastname + "-A-";
return View(toCreate);
}
i tried that code, but ASP.NET MVC keep showing the values submitted by the user
[UPDATE]
this:
[HttpPost]
public ActionResult Create(...
Hi all,
I'm on project using asp.net mvc2.
In master page I have some lines of code line this
<% Html.RenderPartialView("Header", Model.HeaderData) %>
...
<% Html.RenderPartialView("LeftMenu", Model.MenuData) %>
...
<% Html.RenderPartialView("Footer") %>
How could I apply caching to RenderPartialView
Thanks
...
I want to post some Products that has a ID and some Categories with jQuery. But I get a error in: Microsoft.Web.Mvc.DataAnnotations.DataAnnotationsModelBinder.BindProperty (NullReferenceException), when I add the Categories.
Should not the default ModelBinder be able to bind this (without a ActionFilter or custom ModelBinder)?
I tried ...