asp.net-mvc

Graphing/Crystal Reports with ASP.Net MVC

Hi stack overflow community, I would like to add graphing to my User Controls in ASP.NET MVC. I'm fairly new to MVC just jumped into it about 2 Weeks ago and was hoping for some ideas or a guide on how to approach this issue. I have searched around and found no helpful answers to resolve this issue. I was thinking of doing crystal report...

ASP.NET MVC HandleError

How do I go about the [HandleError] filter in asp.net MVC Preview 5? I set the customErrors in my Web.config file <customErrors mode="On" defaultRedirect="Error.aspx"> <error statusCode="403" redirect="NoAccess.htm"/> <error statusCode="404" redirect="FileNotFound.htm"/> </customErrors> and put [HandleError] above my Controller Cl...

Which Facebook .NET Library is the best to use?

There is a list of projects here, mainly the Facebook Developer Toolkit and Facebook.NET. However, I've seen a lot of negative feedback about the toolkit and it seems like Facebook.NET hasn't been upgraded to the latest facebook API. Are either of these worth using? Any other good libraries out there? Specifically I'm looking to use t...

Can an ASP.Net MVC controller return an Image?

Can I create a Controller that simply returns an image asset? I would like to route this logic through a controller, whenever a url such as the following is requested: www.mywebsite.com/resource/image/topbanner The controller will look up "topbanner.png" and send that image directly back to the client. I've seen examples of this wher...

What Does the DRY Principle Actually Look Like in ASP.NET MVC?

I keep hearing about the DRY Principle and how it is so important in ASP.NET MVC, but when I do research on Google I don't seem to quite understand exactly how it applies to MVC. From what I've read its not really the copy & paste code smell, which I thought it was, but it is more than that. Can any of you give some insight into how I ...

VB.NET generics to C# syntax

Could you please show me the C# Equivalent of this VB.NET code: Public Partial Class Index Inherits System.Web.Mvc.Viewpage(Of List(Of Task)) End Class I am not sure where/how to add it in for C#: public partial class DirList : System.Web.Mvc.ViewPage { } The code is suppose to tell the class to expect a list of tasks from t...

Should I pursue ASP.NET WebForms or ASP.NET MVC

Firstly, I'm a software engineer doing web development in ASP.NET. We have a custom framework that we use that sits on top of .NET so most of my development work leverages more of our internal framework and less of the traditional web forms model. I've done web development for a couple years on my own as well, but I mostly use LAMP (wit...

How to localize ASP .Net MVC application?

What would be best practice to localize your ASP .Net MVC application ? I would like to cover two situations: one application deployment in IIS which would handle multiple languages one language / application deployment. In first situation should you go with somekind of view based thing like, ~/View/EN, ~/View/FI, ~/View/SWE or some...

ASP.net MVC custom string output overloaded operator <%=h

I am currently in the process of making a new ASP.net MVC website, and find myself using Html.Encode all over the place, which is good practice, but gets pretty messy. I think a good way to clean this up would be if I could overload an operator to automatically do Html encoding. Previously: <%= Html.Encode( ViewData['username'] ) %> ...

MVC with SharePoint

Hi, We are looking to use the MVC Framework in our SP Application. This is what we are trying to accomplish... A virtual directory within the SPSite which can host and run MVC. for e.g., /_layouts/MVC/ Any hints on the required configuration changes (if at all this is possible) will be very helpful. Kind regards, Ashish Sharma ...

Users Authentication in ASP.NET

Hey everyone, I was wondering, what's the best approach in creating users authentication for my asp.net-mvc web application. Should I use the Forms authentication using a custom MembershipProvider ? Or should I implement my own login and registration mechanism for my users? ...

How to cache images in memory on the web server for an ASP.NET MVC web app?

I am working on a web application with many images, using ASP.NET MVC. I want to be able to cache the images in memory to improve the performance, but I would like to hear what is the best way to do this. 1) The images are accessible from URL, like http://www.site.com/album/1.jpg. How are the images stored in memory? Are they going to ...

Can you have two forms on a page with ASP.NET MVC?

Using web forms I know that you can only have one ASP.NET form on a page. I've done some implementations where I've used Javascript to add other forms to a page to support things like logon controls (that post back to Logon.aspx instead of the current page). I'm wondering if the single form per page is still present in ASP.NET MVC or i...

How can I declare a combo box in a view to set a value to a model in ASP.NET MVC?

I would like to declare a combo box in a view in an ASP.NET MVC application, for letting the user select a lookup value. I know how to declare plain text boxes but is there an official helper for declaring combo boxes (date time pickers and the rest)?. I also don't know what structure I should pass to my view for giving the values to th...

What is the difference between <% %> and <%=%>?

What is the difference between <% %> and <%= %> in ASP.NET MVC? And when to use which? ...

Handle errors with ErrorController rather than a direct view.

I'm trying to get my head around the Error Handling in MVC. What I'm looking for is a centralized way to catch errors, log them, if possible resolve them, if nessecary take other actions and finally show the correct view to the user. I think I can use the [HandleError] filter for this, but I don't see any way to route it to a Controller...

Microsoft MVC "echo/print/output" etc

With ASP.NET's view engine/template aspx/ashx pages the way to spit to screen seems to be: <%= Person.Name %> Which was fine with webforms as alot of model data was bound to controls programatically. But with MVC we are now using this syntax more oftern. The issue I have with it is quite trivial, but annoying either way. This is th...

How Do You Use jQuery to Simplify Your MVC Views?

I have found jQuery to be a great tool to simplify my MVC Views. For example, instead of including complicated logic to add alternating styles to my tables I just do this... $(document).ready(function() { $("table.details tr:odd").addClass("detailsAlternatingRow"); $("table.details tr:even").addClass("detailsRow"); ...

Real World ASP.NET MVC Applications with Source Code?

I think all of the tutorials and stuff are great on blogs, but sometimes when you actually build an application the way you would code or interact with a system is quite different. I was wondering if you all knew some good real world type ASP.NET MVC applications that have the source code available for experimentation. Off hand I am aw...

Remove the *.cs, *.Designer.cs codebehind files?

Yeah, its a bit on this side of pointless, but I was wondering... I've got all these codebehind files cluttering my MVC app. The only reason why I need these files, as far as I can tell, is to tell ASP.NET that my page extends from ViewPage rather than Page. I've tried a couple different Page directives changes, but nothing I've foun...