asp.net-mvc

Asp.Net Mvc 2 - RenderAction List with a create

First, I use Asp.Net MVC 2 RC 2. What I want to do is to list a comment view and below this view being able to add comment (with validations). For example, something like when you add comment in stackoverflow. Except that my page should work with or without javascript enabled. So to solve that problem I use the new RenderAction and it ...

mvc actionlink show html tags

how can i show html tags like this html.actionlinlk("<b>bla bla</b>", null) it dislay bla bla not bold bla bla-is it possible to show bold text? ...

how to call controller from button click without using ajax mvc

Hi all. I'm new to web programming in general so this is probably a really simple question. I couldn't find anything on the web however. What I want to do is call my controller with the typed search string and return the results from a database and paginate the results. Right now I am using a function that is called when the button is p...

How do I output/log the sql being executed behind the scenes by the Entity Framework?

How do I output/log the sql being executed behind the scenes by the Entity Framework in an asp .net mvc application? In my case I'm using a Sql Server 2005 database. I found this question Linq to Sql logging, but I'm trying to figure out how to do this with the entity framework v1 and asp .net mvc 1.0. Any one have any ideas on how? ...

ASP.NET MVC - Server software requirements?

I've just today learned of asp.net mvc, and I'm wondering what is needed from the server-side to host this. I suppose IIS 6 (and newer) and the .NET 3.5, is there anything else you need? ...

ASP.NET MVC 2 - Membership Provider - ValidateUser() - return login error message

How do I return a string message from the ValidateUser method in my custom membership provider? I need this because I want to perform several checks (user is approved, user is blocked etc.) and give the user a good description, if the login process fails. One option would be to throw an exception, but someone said that this is not a pro...

When is Session_End() called in ASP.NET MVC ?

I have configured my Web.Config file as follow in a ASP.NET MVC 2 project: <sessionState mode="InProc" timeout="1"/> And added the following in Global.asax.cs: protected void Session_End(object sender, EventArgs e) { System.Diagnostics.Debug.WriteLine("Session_End"); } protected void Session_Start(object sender, EventArgs e)...

How Should Subsonic Migrations Be Run For ASP.NET MVC 2?

I'm not having any luck finding where in my code I should run migrations when I start up my application. Obviously this should only happen once, when the app starts. In Global.asax.cs I tried: protected void Application_Start() { AreaRegistration.RegisterAllAreas(); RegisterRoutes(RouteTable.Routes); var repository = new...

asp.net mvc what is the life of a controller?

hi, what is the life of a controller? if i create a controller, store some data in private fields, then the user goes to other pages using different controllers, then clicks a link to come back to the original controller, under which circumstances will that data still be there? thanks! ...

Massive Temp Files Being Generated By Application - ASP.NET MVC/IIS 6

Hi All, I just recently put an ASP.NET MVC application I developed/tested/etc up to my company's production server (IIS 6). However, it is generating some massive temp files (up to 1GB!), which is a problem, since the server is running a 2GB partition. UPDATE: MORE INFO: The temp files are being put into the c:\windows\temp directory I...

ASP.NET MVC and Linq, when to use?

I just started working on an asp.net / C#.net application that is going to call a number of different procedures. The -only- thing these procedures do is create database table views, and the only thing I want to do is to store the information in variables. Then pick out which columns I want to convert to JSON, and then make a JSON string...

Custom Authorize attribute HttpContext.Request.RawUrl unexpected results

We're building an application that is a Silverlight client application, but we've created an MVC controller and a few simple views to handle authentication and hosting of the Silverlight control for this application. As part of the security implementation, I've created a custom Authorization filter attribute to handle this, but am gettin...

ASP.NET MVC - Ajaxified RenderAction

I am happy with what the RenderAction() function does. However, I'd like to ajaxify the loading and storing of data in the partially rendered action, so that everything happens in one page. Imagine the following case: I have an article details view where there's an "Add comment" link beneath the content of the article. When it's click...

Where is the correct place to do culture-specific date/currency formatting for asp.net mvc views?

Given a domain object: class BirthdayDomain { public DateTime Birthday { get; set; } public decimal BirthdayPresent { get; set; } } I have two options for passing this to a strongly-typed view: 1. class BirthdayView { public DateTime Birthday { get; set; } public decimal BirthdayPresent { get; set; } } and in the...

return bool from asp.net mvc actionresult

I submitted a form via jquery, but I need the ActionResult to return true or false. this is the code which for the controller method: [AcceptVerbs(HttpVerbs.Post)] public ActionResult SetSchedule(FormCollection collection) { try { // TODO: Add update logic here return true; //cannot ...

ASP.NET MVC on IIS 7.5

I'm running Windows 7 Ultimate (64 bit) using Visual Studio 2010 RC. I recently decided to have VS run/debug my apps on IIS rather than the dev server that comes with it. However, every time I try to run an MVC app, I get the following error: HTTP Error 403.14 - Forbidden The Web server is configured to not list the contents of thi...

URL Rewriting in .Net MVC

Hi, I'm wondering what is the best way to handle URL in MVC. For ecemple, in my application I have a PageControlle so when I view any page of my website it goes to /website/Page/Index/3 or if it's home page it goes to /website/Page/home and all my link in my menu are build dynamicly with Html.ActionLink() and T4MVC so I don't get anythi...

the best "Simple" CMS system suitable for .Net MVC

Hello, I'm developing a MVC .Net site and would like to implement a CMS system. So far I have looked at Umbraco, which looks good but the help is poor and the getting started video section is empty, and dotnetnuke, which again looks good but I get the impression its aimed at non developers, plus to has much more than I need and want. I...

ASP.NET MVC - getting started with Linq and SQL procedure

Today is my first day using ASP.NET MVC, and I'm finding it very intriguing. I only just started learning asp.net. So basically I'm trying to call a procedure from an MSSQL database, and with it I need to send a paramater "PlaceID", which is an integer. This procedure basically just picks out a number of columns from different tables in...

How do i get FileResult to open new browser instance when returning from a controller?

How do I get FileResult to open a pdf in a new browser instance? I am returning FileStreamResult from a controller like so: return new FileStreamResult(new FileStream(path, FileMode.Open), "application/pdf"); ...