asp.net-mvc

Which assembly/DLL do I need in inetpub/wwwroot for launching aspx pages?

What do I have to add to c:\inetpub\wwwroot folder to serve aspx pages to browsers? My webproject is in this folder but I think I'm missing something for running ASP.NET and ASP.NET MVC webpages. ...

CRUD Update, changing entity relationship with dropdown using ASP.NET MVC 2, and NHibernate

I'm running into a few problems with CRUD Update (Edit) scenarios where an entity relationship is altered via drop down list of possible entities, using ASP.NET MVC and NHibernate. Probably I am just doing something stupid, so I was wondering if someone could give me a quick example of how this should be done, as I haven't been able to ...

Hacking attempts yields "The controller for path '...' was not found or does not implement IController"

We get notified of every error on our MVC2 web application. And we've receiving errors for controller path not found for files we know don't exist and therefore we believe are hacking attempts System.Web.HttpException: The controller for path '/zencart/install.txt' was not found or does not implement IController. What's the best wa...

MVC 2 date validation only required if checkbox is checked

Hi, I am using EF4 and ASP.NET MVC 2 for my web application. I am also using data annotations for my validation. Is the following possible? If so, how would I implement it? I have a checkbox, and a from and to date. The from and to date are not required fields, but when the checkbox is ticked then the from and to dates are required...

Data annotation attributes not working using buddy class metadata in an MVC app.

I have found hints that MVC 2 recognises the 'buddy class' type of property metadata, where data annotation attributes are applied to a 'buddy' metadata class, and the MetadataType on the actual entity class points to that buddy class, as below. However, as below, it seems the only attribute that makes any difference to the rendered UI ...

asp.net mvc and webforms shared authentication

I have few websites based on the WebForms and one based on MVC. All websites have the same settings for forms authentication in web config. The problem is that once logged in to WebForms website, I have to re-login for MVC websites, but when I log out from MVC website, I am automatically logged out from WebForms websites. How can I pas...

How do I set the correct decimal separator in IIS 6.0?

Hello everybody, I hope you can help me here... I have a conflict with the decimal separator on my host's dedicated server. The DB (SQL SERVER 2005) uses dot as decimal separator. As a fact, if you query it directly using SQL Server Management you would get dots. However, when the application (.NET C# MVC 2) is running it uses comma inst...

Why is EF4 trying to re-create my database even though the model hasn't changed?

I have an ASP.NET MVC 3 Beta website using SQL Server CE 4.0. With both ScottGu's NerdDinner example and my own code, I will sometimes get the following exception as soon as I try to access the database: File already exists. Try using a different database name. [ File name = D:\Sourcecode\NerdDinner\NerdDinner\App_Data\NerdDinners.sdf...

how to avoid repetition of data for a repeated dropdownlist input?

I have a webpage that should be relatively lightweight, the problem is that i've got a table with editable user data on each line and the data includes a dropdownlist with hundreds of options. i've argued against the use of so much values but i guess i wasn't able to come up with a satisfying solution; so the ginormous dropdownlist stu...

Mvc .net Session Expiration issue

Hi I am working on MVC.net. In my application what i have done is after 15mnts I have displayed popup on the screen to warn that the session is about to expire. and if user click on the "ok" button then an async request is sent to server to refresh the session. but it is not actually refreshing the session. What could be the reason? Can ...

Asp.net MVC 3 inject UserControl for TemplateHint

Is it possible to somehow leverage the dependency injection in Asp.net MVC 3 (using the Forms ViewEngine) to inject UserControls from another library? I am already using MEF to load some other stuff into my MvcApplication. I need this because I want to build a system with an expandable type system. I want the type vendor to be able to ...

Why does IIS7 take a long time

It looks likes if I don't visit my low traffic site for a day, it takes a long time for the first page to load. I believe it's probably because IIS7 shuts down the application when it receives no requests for a certain length of time. How can I stop this from happening? I have a dedicated server so I have all the access required to c...

MVC, WCF ASP.NET 4.0 & JQUERY

Hello, I've spent the past few days getting frustrated with WCF, so I've decided to post for help on here because.. well.. I don't have a clue where to start!.. any help would be appreciated! Firstly: When creating a WCF Service in .Net 4.0, which template should I use if I want to be able to create a service that will accept data from...

MVC using Action Filter to check for parameters in URL. stop action from executing

I want to make the following: when the url doesn't have an instID, i want to redirect to the "Instelling" action in this controller, every method needs the instID. [RequiredParameter(parameterName="instID", controllerToSend="Instelling")] public ActionResult Index(int? instID) { //if (!instID.HasValue) { ...

Asp.net mvc app running in Azure Dev. Fabric and RequireHttps attribute

I have a Asp.Net MVC that runs on Azure Dev. Fabric. I have a few pages that need to run under SSL, so I marked the corresponding controllers/actions with requiresHTTPs attribute. Now when I run the app, as soon as I navigate to pages that redirect to https, IIS throws 404 error. I created a self-signed certificate for IIS, thus https://...

ASP.NET MVC: add new SQL Server database gives login failed error

Hi, I'm just getting started with ASP.NET MVC. I'm following the NerdDinner tutorial (http://tinyurl.com/aspnetmvc). On page 20 of the PDF. I am adding a new SQL Server database to the project, and confirming that I want to add the .mdf file to the App_Data folder (from the prompt "Do you want to place the file in the App_Data folder?...

TDD and MVC Model Binding

Let's say I have this unit test: [Test] public void LastNameShouldNotBeEmpty() { ExampleController controller = new ExampleController(); Person editedPerson = new Person { FirstName = "j", LastName = "" }; controller.EditPerson(editedPerson); Assert.AreEqual(controller.ModelState.IsValid, fa...

Password protect a whole .net mvc application?

Hellu, I want to put a password protection on my entire web application for development and testing purposes. I would like some simple way to do this (global asax, webconfig etc), which means I don't have to change very much in the rest of my application. The password and username can be stored in the code/webconfig or whatever. Since ...

Error with ViewModels and Create/Edit Actions

I'm trying to create a ASP.NET MVC 2 webapp using the Northwind database following the NerdDinner tutorial, but now I keep getting the following error when trying to EDIT a product: Value of member 'SupplierID' of an object of type 'Supplier' changed. A member defining the identity of the object cannot be changed. Consider adding...

How and when to deal with database that is down ?

My problem is that I have to deal somehow with cases when database is down in my MVC application. So, should I like try{} catch{} to open connection in every controller? Or what is the best practice? Note: For sample database access is isolated in few "manager" classes that work repository kind of way. ...