asp.net-mvc-2

Cannot get IIS7 to work with my MVC Site

Okay I've read the other StackOverflow postings, forum posts on MSDN, everywhere. I CANNOT get this to work for the life of me. Here is what I have setup. In IIS7.0 - Default Site in ASP.NET v4.0 App Pool - C:\Inetpub\wwwroot as the physical path I published my MVC2 site in VS2010 to the Default Site path, it succeeded. Here are the ...

MVC 2 Routes issue (bug?)

Hi all, So, I've run into a weird issue with a route in my application. For some reason it just won't match. It looks like {controller}/Comments/Put and it has corresponding constraints to make sure it gets into the right controller, in this case "Misc". When I post to the route it just doesn't match... I plugged in the RouteDebugger l...

AJAX Control Toolkit TabPanel on an ASP.NET MVC View gives an HttpException "OutputStream is not available when a custom TextWriter is used."

I have installed the AJAX Control Toolkit following the included instructions and I'm trying to add a TabContainer with a couple of TabPanels to a view in an ASP.NET MVC application. Is this possible? I can get the TabContainer and TabPanel controls to work in a Webforms application but not in MVC. In one of my views I have the followi...

What is the 'best way' or 'best practise' for communicating errors to the View from a service layer in MVC2?

I had issued with using a ModelStateWrapper in MVC 1 as described here: http://www.asp.net/mvc/tutorials/validating-with-a-service-layer--cs As much as I was able to test my application it still felt like there was a dependency/circular reference with the ModelState, the controller and the service layer. With the new DataAnnotation in M...

How to call an external program in ASP.NET such that each visitor gets isolated?

Dear all, Actually I don't know whether my question is related to this thread. I want to create a web application using ASP.NET MVC 2. For simplicity, let my scenario be as follows: A visitor is allowed to submit a text file and get a pdf output from the server. There is an Adobe-Acrobat-like application, that can convert text to pd...

implement tree view in MVC 2...

I am a newbie to ASP.NET MVC 2.0 . My problem is to find a solution for generating a tree view in MVC without using jQuery(it's must not to use treeview() in jQuery..).I read in some sites that ASP server controls not support by MVC. So please any one clarify this have query ...thanks in advance. There is one more query about the Ajax ac...

VB.NET Default Namespace - problems using it and not using it... What is the way around this issue?

Hi, I am building an MVC2 website using VB.NET. I had a root namespace defined for the project but blanked it out because I wanted to have full control over the namespace for each class in the project. The reason I require this control is that I define a bunch of htmlhelper extensions and want them be in the same namespace (System.Web...

ASP.NET MVC2 and clean URLs for GET requests

...

Validation Attributes MVC 2 - checking one of two values

Hi guys/gals, Could someone help me with this issue. I'm trying to figure out how to check two values on a form, one of the two items has to be filled in. How do I do a check to ensure one or both of the items have been entered? I'm using viewmodels in ASP.NET MVC 2. Here's a little snip of code: The view: Email: <%=Html.TextBoxFor...

asp.net MVC open file from folder and view info such as extentsion and contenttype etc

HI there I know how to get details from a file when i am uploading it, but am unsure how to do this when the file is already on the server and i wish to get information like size, contentType etc drawn a blank much appreciated. thanks ...

ASP.NET MVC 2.0 Simple Routing Question

Im in the process of moving our website from a crappy CMS over to a nice custom coded MVC website. Everything has gone smoothly so far but I'm having some issues with routing. Our company sends out a lot of marketing emails and letters. In these we have the user go to Landing Pages so we can track how campaigns are doing, as well as o...

How to manage multi tenant web portal css using Asp.Net MVC

I am designing a multi tenants web portal application using MVC. Tenants will be identified by URL or tenant id. We are going to have a default set of skins and themes but per requirement each tenant can have its own skins and themes. What is the best way to handle/attach css for multi tenant web portal application? ...

ASP.NET MVC 2 AJAX Calls when login token has expired

When a users login token has expired (ie. they have been logged out) on a page that has AJAX enabled content, if they select a AJAX link on the page it will appear to complete succesfully. However this is not the case. The content that was returned to the page is the Login Redirection. Is there any way to have the AJAX call redirect to t...

ASP.NET MVC2 - Redirect to Url in overriden controller

I've created a ControllerBase class that overrides the Execute method of the default Controller class. I'm doing this to check the url and pull an associated page from our database. If the page isn't found, I want to redirect to a specific url ("invalid-page"). All is working except the redirect. I've tried to use Response.Redirect("inva...

How to achieve a dynamic controller and action method in ASP.NET MVC?

In Asp.net MVC the url structure goes like http://mysite.com/{controller}/{action}/{id} For each "controller", say http://mysite.com/blog, there is a BlogController. But my {controller} portion of the url is not decided pre-hand, but it is dynamically determined at run time, how do I create a "dynamic controller" that maps anything t...

Dynamically loading a jQuery based script and the ready event.

Hi, I'm using the ASP.NET MVC Framework, jQuery and Ajax calls to do some Partial view rendering based on client input, my issue is that some of the scripts requires by the partial view rely on the ready event, raised by jQuery. The scripts, both external, and on in the view are being loaded without issue, but as the page is already lo...

MVC DataAnnotations - Require at least one field in a group to be filled

Hi, How can I use DataAnnotations to validate that at least one of these fields are filled in? public string Name { get; set; } public string State { get; set;} public string Zip { get; set;} ...

How do I test rendered views when using T4MVC with TestHelper?

How do I test which view was rendered from a controller action if what I get is a T4MVC_ActionResult? Under normal circumstances I should be able to directly use TestHelper's methods, like in the examples: pooController.Details().AssertViewRendered().ForView("Details") ...but, since through T4MVC I get a T4MVC_ActionResult instead of ...

Need help using entities for ASP.NET MVC 2 framework

I'm making a site in ASP.NET MVC 2 using C#. I designed a database with a bunch of tables that have many to many relationships, similar to the following: GrandParent - many to many - Parent and Parent - many to many - Child I used the Entity Framework to make all of the entities class and am now working on a function in a repositor...

HTML in ASP.NET MVC

Hi all, Asp.net is my first incursion into web development using server side tech. The last time I used HTML was when tables where used for rendering and CSS was a dream. I know the usual tags but I've come across some like <form /> and <input />. I haven't used these or CSS before. I am running under the impression that these are stan...