asp.net-mvc

IMultipleResults LINQ DBML Classes Not Resolving

In my partial class which defines a function which returns the type of IMultipleResults to bring back multiple result shapes from a stored procedure using the classes defined in my *.dbml file, for some reason the [ResultType(typeof(MyType))] isn't working. The MyType is saying that it cannot be found. The function is in the .cs file o...

ASP.NET MVC how to handle the default empty value for dropdown list

I create a dropdown list by using ASP.NET MVC helper like this, <%=Html.DropDownList("Group","-please select a group-")%> and I get the html like this, <label for="GroupId">Group:</label> <select id="GroupId" name="GroupId"><option value="">-please select a group-</option> <option value="15">Business</option> <option value="16">Frie...

Extending System.Data.Linq.DataContext

I have a class reflecting my dbml file which extends DataContext, but for some strange reason it's telling me System.Data.Linq.DataContext' does not contain a constructor that takes '0' arguments" I've followed various tutorials on this and haven't encountered this problem, and VS doesn't seem to able to fix it. Here's my implemen...

using a usercontrol on aspx page in MVC using partial view

I have Dropdown and on click of a button, I want to display data in the usercontrol the below code is not working as expected. <asp:Content ID="Content2" ContentPlaceHolderID="MainContent" runat="server"> <% using (Html.BeginForm()) {%> <%=Html.DropDownList("CarMake", (SelectList)ViewData["CarMake"])%> <input...

ASP.NET MVC Urls and IIS Integrated Windows Authentication

I have an ASP.NET MVC app which is completely behind Forms Authentication. However there is one set of routes (/report/%) I need to force integrated windows authentication on, as those pages need to impersonate the current user (for security reasons). If I set the whole site to integrated windows authentication this all works, except t...

ASP.Net MVC Image Upload Resizing by downscaling or padding

A user will be able to upload an image. If the image is greater than a set size I want to downsize it to that size. Obviously it doesn't have to match exactly due to ratios, the width would be the key size so the height would be variable. If the image is smaller than the set size I would like to create a new image to the set size with ...

ASP.NET MVC and long running actions

I have a controller action that aggregates data from multiple sources: web service, database, file lookups, etc... and passes results to the view. So in order to render the page all tasks must have completed. Currently they are performed sequentially but as they are independent I am thinking of running them in parallel as this could impr...

Syntaxhighlight - as control it works very vell, as partial doesn't

Hi, I have very simple control: <%@ Control Language="C#" Inherits="System.Web.Mvc.ViewUserControl<ConfiguratorMVC.Models.SpecyficationController.ViewSpecyficationViewModel>" %> <link type="text/css" rel="Stylesheet" href="/Content/shCore.css" /> <link type="text/css" rel="Stylesheet" href="/Content/shThemeDefault.css" /> <h2><%= Mod...

What are all the available ActionResults for ASP.NET MVC?

What are all the methods that return an ActionResult in ASP.NET MVC as of right now (ie. RedirectToAction, etc.) I haven't found a good documentation resource that lists this kind of stuff. ...

How do you use the MVCContrib Grid control?

I'm trying to use the GRID control in the MVCContrib library with my controller. The paging control for their Grid seems to have a big limitation, it only outputs a URL as MyPage.aspx?page=2. So when I press NEXT PAGE on the control is spits out "MyPage.aspx?page=2" My control looks like this: public ActionResult Index(int? page)...

LINQ to SQL how to get value by field name

I use Linq to SQL as data access layer in ASP.NET MVC application. So the query result is a strong typed object. How can I dynamiclly specify which field to show in the page. For example, the query result has the following fields: FirstName LastName Address Tel My question is if one user wanna show the Lastname and the Firstname. 2nd u...

Location of System.Web.MVC so I can reflect over it with reflector

I installed MVC 1.0. Where's the System.Web.MVC dll so that I can use reflector to see how the helper methods are coded? I've looked in the bin folder of my ASP.NET MVC web app but it's not there. I am not quite sure where the MVC 1.0 installer installs the dll and how that wires up to the web.config of your MVC apps. Is System.Web.MV...

How would you handle this situation with nHibernate

I have 2 tables in my database: Category BlogEntry Each BlogEntry has 1 or more Categorys associated with it. If I want to get a BlogEntry by its ID, I also want to get its Category information. Maybe this example doesn't illustrate exactly a scenario where this would make sense, but say I want to load the Category ID and Name only...

asp .net mvc and castle mono rail about upload multiple files

Hello, im trying to upload multiple files using castle mono rail with framework 2.0 I did my controller for that but just for 1 file. When i try to re write for multiple files using the Request.Files i have problems. Asp .Net mvc can work with that but castle don't :( I'm trying to use something like HttpFileCollection hfc = Request.Fi...

Asp.Net MVC on Subdomain, standard MVC app gives 404's

I am trying to deploy my MVC app on a subdomain, unfortunately I get 404 errors. I tried to find out if it's MVC itself that can't handle being hosted on a subdomain. I uploaded the standard bare MVC webapp that you get when you start a new project. The index page loads, but all the other pages that require actual routing based on the ...

IoC and ASP.NET MVC Views

Is there a good way to get my IoC to resolve dependencies on views? I have my own IoC resolver based on Castle Windsor. I have a IResourceService that I would like to have access in my views to resolve some strings. ...

How to configure and debug a web application using MVC and WebForms

I have an existing ASP.NET web application that I'm converting to MVC 1.0. The site started out with one goal. However, over time our sponsors are asking for more functionality and it is obvious that MVC would be our best route due to the new requirements. I've dabbled in MVC over the last couple of months and have a pretty good grasp on...

jquery star rating plugin help needed

I'm adding the star rating plugin from www.fyneworks.com/jquery/star-rating/ and I'm finding the documentation rather obscure. It may just be that I'm looking in the wrong places, which wouldn't be that unusual for me. We are on an asp.net MVC application, and I would like to add the star rating object in 3 different pages. On the "...

Virtual Earth won't render properly in ASP.NET MVC view.

The following code: <body onload="GetMap()"> <script type="text/javascript" src="https://dev.virtualearth.net/mapcontrol/mapcontrol.ashx?v=6&amp;s=1"&gt;&lt;/script&gt; <script type="text/javascript"> var map = null; function GetMap() { map = new VEMap('myMap'); map.LoadMap(); }...

ASP.NET (MVC) jQuery Intellisense -> Error in ReSharper

I'm working on an ASP.NET MVC project using jQuery. I'm referencing the jQuery VSDoc file (jquery-1.3.2-vsdoc.js) in order to get Intellisense for jQuery in Visual Studio: <% /* %><script src="~/Scripts/jquery-1.3.2-vsdoc.js"></script><% */ %> Then Resharpers live solution analysis (the red/green symbol in the lower right status bar)...