I have a very odd problem. Whenever I try to use the "Add View" dialog in ASP.NET MVC2 and then try to "Create a strongly-typed view" by selecting a "View data class" from the drop down of available classes none of the classes ("models") in my MVC project are showing up.
The very odd part is all of the assemblies that my MVC project is ...
I have a Create view which is passed a ViewModel. The ViewModel contains the following:
namespace MyProject.ViewModels
{
public class MyObjectCreateView
{
public MyObject MyObject { get; set; }
public List<OtherObject> OtherObjects { get; set; }
}
}
The objects are generated using Entity Framework. I have...
I am building a ASP.NET MVC 2.0 app on .NET 4.0 and am using Structuremap 2.6.1 for IoC. I recently added a ICookie and Cookie class, the Cookie class takes HttpContextBase as a constructor parameter (See below) and now when I run my app I get this error :No Default Instance defined for PluginFamily System.Web.HttpContextBase.
I have us...
Hi guys i'm new to JSon and not too sure how do i pass the data around. I am using ASP.NET MVC as my development platform.
In The View:
$(document).ready(function() {
$("select#Colors").change(function() {
var photoCategory = $("#Colors > option:selected").attr("value"); // 1st parameter
var userID = $(".userID").att...
I found this link for the MicrosoftMVCAjax file for ASP.net MVC 1. Changing the url like so for version 2 yields a 404.
Does anyone know what the correct URL is (if it exists)? If not - does someone know when we can expect this to be updated?
...
Hello Everyone,
i m using asp.net mvc2 for my application. i have a view that accepts a model and renders its data in some format. i want this page to be converted into pdf file so it can be sent via attachment or created and downloaded on the fly. i have some success creating pdf with itextsharp library but they say it has very basic s...
I have a contradiction to deal with:
I need to make a stylesheet load for a reporting object (for ASP.NET -- it requires runat), however, it won't compile when I have <% %> tags in . I need the <% %> stuff in to load stylesheets and jscripts for the rest of the page.
So, I'm going to load the reporting object into an wrapped in a n...
Hello,
I have a partial view where I render, if the user has choosen an option, a button that permit the user to generate automatically a value for a certain field. Please give a look at this picture to understand what I mean:
This is achieved using the following markup on the partial view
<%= Html.LabelFor( model => model.IssueCode...
<%: Html.ActionLink("Share Me", "Index", "Mall", new { username = Model.Username }, null)%>
results as expected according to mapped routes:
<a href="/Mall/Username">Share Me</a>
I however need it to not say Share Me but to show the absolute URL, as well as use the absolute URL as the href:
<a href="http://www.url.com/Mall/Username"...
Hello,
I have an ASP.NET 4.0 MVC web application running on IIS 6.0 with a webconfig custom error section of:
<customErrors mode="On" redirectMode="ResponseRewrite" defaultRedirect="/Home/Error">
<error statusCode="403" redirect="/Home/Error"/>
<error statusCode="404" redirect="/Home/Error"/>
</customErrors>
and an error.aspx page...
Hello - I'm porting an existing system to ASP.NET MVC2. In the current legacy app, the user can select from dozens of available fields to customize CRUD forms for different entities in the domain model, similar to the way ERP systems allow customization of core modules.
My question: I'm looking for a good pattern or example for this ki...
In my model I have relationships like this:
[Person]
PersonId (PK)
...
[Orders]
OrderId (PK)
PersonId (FK to Person.PersonId)
...
A person can have multiple orders.
I generated PersonController with Create/Details/List/Edit views. I want to be able to manipulate Orders also, but within the context of a Person. In other words, I...
Hi I have a MVC site and will have users inputting text to be displayed on a web page.
I am trying to come up with a graceful way of handling any HTML that the user try's to input - as you will probably be aware MVC 2 throws an error for any HTML in the text.
I use ViewModels and decorate my properties with filters from the DataAnotatio...
I'm trying to take a .net 2.0 app into the .net 4.0 world. We are leaving the webforms as is and adding new functionality in MVC2.
While we could redo all of our managed fusion rewrites as mvc routes, so for the moment, I'd rather just add the new routes to MF and have it handle url rewriting duties for both webforms and controllers.
...
I have a webservice that returns for example a DateTime object: DepartureDate.
I use ajax to fetch this and in my view I convert the JSON date string to a javascript date object with this function:
function convertToDate(jsonDate) {
return eval("new " + jsonDate.substring(1, jsonDate.length - 1));
}
The problem is that new Date() ...
Hi.
I have my image from Request.Files[0]. Now, how do I upload this image to S3? I see that in the AWS .NET API you have to specify ContentBody when putting an object which is a string. How would I get the content body of my file?
...
Strange thing is happing with my .NET MVC deployment.
I have tested my application on my development environment, and on IIS of my Win7 and every works as expected.
But after deployed my application on Windows Server 2008, Login/Authentication page appear, on almost every pages, even to access 'scripts' and 'contents' folders.
Any tip...
Hi,
Iam trying to pass data from my controller, and put it into the variable in JS script. I have done it before and it worked perfectly, thats why this one puzzles me even more.
Here is my code of the controller:
public ActionResult GetCategories()
{
var categories = categoryRepository.ListActiveCategories().ToLi...
My ASP.NET MVC 2 application uses Entity Framework 4.0 for the data model. Following the instructions on http://blogs.msdn.com/b/aspnetue/archive/2010/09/17/second_2d00_post.aspx I put the .edmx in its own assembly so my solution has two projects:
MyApp.Core (ASP.NET MVC 2 Web Application Project, references MyApp.DataLayer)
Models/
C...
Hello SO,
I am trying to implement the TinyMCE Spellcheck plugin that uses GoogleSpell. The thing is I am trying to install it in an MVC environment.
I started by referencing the .NET class Library DLL (MoxieCode.TinyMCE) in my project.
Then, I added this code to my web.config:
<system.webServer>
<handlers>
<add name="TinyM...