asp.net-mvc

ASP.net MVC [HandleError] not catching exceptions.

In two different application, one a custom the other the sample MVC application you get with a new VS2008 MVC project, [HandleError] is not catching exceptions. In the sample application I have: [HandleError] public class HomeController : Controller { public ActionResult Index() { ViewData["Message"] = "Welcome to ASP....

How can I properly handle 404s in ASP.NET MVC?

I am just getting started on ASP.NET MVC so bear with me. I've searched around this site and various others and have seen a few implementations of this. EDIT: I forgot to mention I am using RC2 Using URL Routing: routes.MapRoute( "Error", "{*url}", new { controller = "Errors", action = "NotFound"...

Can ASP.NET MVC be applied to web services?

I'm architecting an web based application which will make use of web services. It has been recommended that I look into the use of the ASP.NET MVC Framework. All of the information I'm finding on the MVC discusses it's use with web pages, but I have found nothing regarding web services. Can the MVC be used for web services? and if so,...

Why will my images/script not show up on asp.net mvc deployed site?

I have deployed an app to an IIS6 server. For now, I'm using the wildcard mapping. My app works perfectly fine on my development machine, but when I try to access it on the server, some pages work and some don't. It is the scripts & images that are giving me the biggest problem. I have a url http://localhost/sdev/home/index and the p...

Pass website URL into the Route in ASP.NET MVC

I am working on a project that needs to grab the actual URL and use it in the route itself. Everything I am seeing, reading and testing allows the route to grab the items after the site URL. This is what I have tried and each time it simply say the site is blank (which is probably because of the default of blank). Can you throw me any...

Using HtmlHelper in a Controller

Is it possible to use HtmlHelper in a controller, for-example to get the TextBox(...) method? not that I can't write the html that it generates myself, but I just want to understand how this works so I can create the best solution. Thanks in advance! ...

How to get the foreign key in Entity Framework?

Hello, I am developing StudentApp in .NET 3.5 SP1 MVC Application. I have two tables Course CourseID, course_Name Students studentID, student_Name, courseID(fk) Now I made StudentApp.dbml which is having both table as entities. As Foreign key will not be present in student entity, I can not display courseID in student mode...

How to show the List returned to view by controller?

Hello friends. I am using VS 2008 MVC. I developed a controller. Form controller i fetch the data by using LinqToSql. & i am retuning a list of that data. e.g. return View(Students.Tolist()); now i want to display the list using "foreach" loop in view. so how do i achieve it? ...

N2 MVC controller action caching?

Hi all, I've got a really odd problem when using N2 with MVC. It seems to be related to the N2 side of things, as it doesn't happen within a purely MVC only app I wrote to test. Basically, when making calls to controller actions from within a page, the controller action parameters act as if they're being cached if they get called more t...

can i Run KiGG on XP Pro?

I have XP pro edition with .Net 3.5 installed and IIS 5.0 and MVC RC 2 Can i run KiGG on this machine? Also i have on my hosting server IIS 6 and .Net 3.5 , can it run there or no also? If no, there is no work around to make it work? Thanks, ...

Modal Form in asp.net mvc RC using jquery

I am new to ajax / jquery and have had difficulty finding a simple sample incorporating the following: ASP.Net MVC RC1 (or 2) jquery modal form I would like the user to be able to click a link/button in a View (Parent) and have a modal form appear that contains a form. the contents of the modal dialog should be an MVC view (Child). ...

Where should "Master Page" logic go in MVC?

I'm experimenting with MVC, and my question is - where I had Page_Load logic in Master Pages with WebForms, where should it go in MVC? Here's the business case: Different Host Headers should cause different Page Titles to be displayed on the site's (one) Master Page, therefore all pages. For example, if the host header is hello.mydomai...

Files in website deployment

Which files do I have to deliver when I do an ASP.NET (MVC or not) deploy? I want to know only the absolutely neccesary files. Also, how can I obfuscate some of them to prevent decompiling? I don't want to use the publishing wizard since it requires having FrontPage extensions installed on the server. ...

Setup IIS in localhost as web development server

How can I setup IIS 5.1 in Visual Studio 2008 as my web development server? I'm using Win XP, and I was using Cassini, but I want to give a tray to IIS instead of. ...

ASP.NET MVC Templating

I have repetitious markup for elements, like: <div class="box"> <div class="top"></div> <div class="content"> content goes here </div> <div class="bottom"></div> </div> Top and bottom are styled with css to include images for borders. I could use JQuery to inject tags, but is there a better way to template contr...

Rendering multiple views from multiple controllers on a single page

On the main page of my site, I would like to show several views which rely on their own controllers for data retrieval. I do not want to retrieve anything from the DAL in my Home controller. For example, I want to show view listing top 5 news, a view with random quote from the database, another view with the users shopping cart contents...

LoginStatus for ASP.Net MVC?

Hi There, How do I get the LoginStatus for ASP.Net MVC? I can connect and authenticate on MVC, but I am not sure how to get the LoginStatus, can anyone help? Thanks ...

How to keep related entities on object when returned from ASP.NET MVC view

I am working on an ASP.NET MVC RC2 app using Entity Framework. This is my Entity diagram. In my repository I get the entity like this: public Product GetProduct(int id) { return (from c in _entities.ProductSet.Include("User") where c.Id == id select c).FirstOrDefault(); } My view: <%@ Page Title="" Langu...

ASP.NET MVC Html.SubmitImage

I am looking for Html.SubmitImage in RC1 and don't see it anywhere when reflecting through the MVC assemblies. Has it been moved / removed? ...

ASP.NET MVC Security Recommendations

Hi, I have recently started a personal project that uses ASP.NET MVC (RC1 at the time of writing). My background is traditional ASP.NET WebForms development. My knowledge ASP.NET MVC is limited, so I would like your input on how to best approach authentication, input validation and protection against common attacks (XSS, XSRF, etc). I...