asp.net-mvc

How can I detect internet conection in Asp.Net MVC to use Google Maps?

I am developing an Asp.Net MVC application that uses Google maps to show Addresses in a map. The problem is that I need to demo the app in an environment not connected to internet. How can I detect with an script that the app is disconnected not to call the Google maps api functions? ...

Create Visual Studio (vs.net) 2008 Solution Templates?

Is it possible to create vs.net 2008 solution templates. From my search results it is not possible to create a solution templates with all the respective project references. I have a vs.net solution with multiple projects and references in each. I would like to wrap all of them up into a template where I can use as standard base start...

mvc 1.0 doesnt work on IIS6

Hello I have a strange problem with my MVC 1.0 application that I published on IIS6. When I try to surf to the pages no routes match and I get page not found. I have installed 3.5sp1 on the webserver and everything needed. Seems like there is lots of files missing (?) or the filestructure isnt the same as in my project folder. What m...

Custom Error Handling in ASP.NET MVC

I've tried implementing the answer listed here: Properly handling 404s which came from this blog post: Real World Error Handling All I get is a blank page. I step through the debugger and I see the Exception catch, the ErrorController method get called and the return of the View execute, but then I don't see anything in the web browser...

ASP.NET MVC - Navigation Approach

Hello, I am new to ASP.MVC. My background is in ASP.NET Web Forms, I think this is what is causing my confusion. I understand that the "M" basically represents the data source, the "V" represents the resource I'm requesting and the "C" dictates what gets shown to an end-user. But then I get confused. For instance, I'm just trying to c...

Asp.net mvc run on part of website

I have a current website running with asp.net 3.5. I have been using the asp.net ajaxtoolkit with update panels for a while and I'm starting to get tired of it. So I have been starting to look at asp.net MVC and jQuery instead. It looks great! My website is quite large and it will take a loong time to rebuild it all in MVC. Therefore m...

Can I create an ASP.NET MVC 2 project with multiple areas without referencing each Child in the parent area?

This is a follow-up question to my original query: http://stackoverflow.com/questions/1791605/how-can-i-use-multiple-projects-to-separate-a-large-asp-net-mvc-site-into-departm Now that I have this working, is there a way to still have multiple project but not have to reference each child area from the parent project? Ideally I'd like ...

How IIS requests are parallelized using COMET?

I have an ASP.NET MVC 2 Beta application where I need to block incoming requests for a specific action until I have some data available to return or just release the request after 30 seconds with no new data available. In order to accomplish this, I'm using AutoResetEvent.WaitOne(30000); The big issue is that IIS does not seem to be ac...

How do I extend ASP.NET MVC2 out-of-box validation to validate creditcard / emails ?

I've been looking at the file MicrosoftMvcJQueryValidation.js which is the layer between your page and the jquery.validate object in ASP.NET MVC 2 Beta. It will allow any type of validation rule supported by jquery.validate and had additional special handling for regularexpressions, strings, ranges and required fields. If it is a generi...

ASP.NET MVC - Controllers Not Recognized

I've been spending the past several weeks working on my asp.net mvc site following along in Apress' Pro ASP.NET MVC Framework. All has been well and good and the app has been running just fine. I'm almost done with it. I was attempting to move it to the test server for QA, when the server admin wanted me to remove my extensionless sys...

Service Layer to Automatically identify database to use

I am working on a asp.net MVC application. The app is structured as follows: Web MVC Services - Business Rules Data The data layer is using LinqToSql to query the sql database. When the user logs into the application, based on the username, I can do a lookup to check which organisation they fall under. Depending on the organisatio...

What is your opinion of the Telerik Extensions for MVC?

I've started digging around with using the Telerik Extensions for MVC. They don't integrate seemlessly into my current project, but I could reorganize things to fit it in. But, I'm wondering if it would be worth it in the end. I've been searching for reviews on the extensions, I haven't seen too many. So I'm asking here. On their websi...

How to write test case for mvc action filters?

Hi, I have an action filter which i got from the below link http://blog.wekeroad.com/blog/aspnet-mvc-securing-your-controller-actions/ there is something called "RequiresAuthenticationAttribute" for this i need to write test case. how can i do this? form some of the blogs i read that we need to mock httcontext. How can i mock this? wha...

How do I link to Downloadable files in ASP.NET MVC?

I am new to ASP.NET MVC, and am trying to link to downloadable files (.zip, .mp3, .doc, etc). I have the following view: ProductName which maps to: http://domain/ProductName I have a .zip file that must map to URL http://domain/ProductName/Product.zip Questions Where do I place this .zip file in the MVC folder structure? How do I a...

ASP.Net MVC: How can I easily change the tab color of my navigation menu based on the tab that I'm on?

I want to implement my navigation tabs somewhat like the ones on this site, and I've heard that this was built using ASP.Net MVC. If I'm on stackoverflow.com/users, than the "Users" menu tab is orange and all others stay grey, same if a different tab is selected. I am pretty good with manipulating the css to change color when it's hove...

Should ActionResult perform other tasks too

In Asp.net MVC one is encouraged to derive custom ActionResults, however should these classes handle other tasks unrelated to views, perhaps a EmailActionResult would render a view then send an email. What is best practice for the class ActionResult, is it only view specific? I want to keep things DRY too. Should the sending of the email...

Route controller to Foo/{Action}

Hello I was wondering if there is some easy way to route an entire controller to something like: Foo/{Action}? or do I have to write a route for every action in that controller? /M ...

MVC Model Binding

I am using the MVC validation library from link text. I chose this library because I am also using .NetTiers which generates all of the Validation Attributes using MS Enterprise Library Validation Blocks. It works fine except that that model binding is automatically validating the object and populating the Validation summary. I believe...

How can I change the ASP.Net MVC Login Redirect based on role?

I have the following code I've typed into the Account Controller in my MVC project and I am in both the administrator and manager roles. When I log in I get redirected back to my home index instead of being redirected to my AdminApp index. Any ideas where I'm going wrong in my code? [AcceptVerbs(HttpVerbs.Post)] [System.Diagnostic...

Parameterized controller constructor never gets hit

With my pet project I'm trying to learn to use Turbine as a DI container. I'm registering unity as locatorprovider as such: static MvcApplication() { ServiceLocatorManager.SetLocatorProvider(() => new UnityServiceLocator()); } My user repository has a parameterless constructor and I'm registering it as such: public class UserRep...