asp.net-mvc

ASP.NET MVC - Solution Layout Suggestions

I have been working with ASP.NET MVC for a couple of months now and I'm still not happy with the layout of my project's solution. I am trying to construct a mid-sized website CMS that is as portable and reusable as possible and there are some obvious problems in the design of it. I am looking for some advice regarding how I should struct...

Executing Method Against DataContext Returning Inserted ID

Is there any way to use DataContext to execute some explicit SQL and return the auto-increment primary key value of the inserted row without using ExecuteMethodCall? All I want to do is insert some data into a table and get back the newly created primary key but without using LINQ (I use explicit SQL in my queries, just using LINQ to mo...

Html helper for <input type="file" />

Is there a HTMLHelper for file upload? Specifically, I am looking for a replace of <input type="file"/> using ASP.NET MVC HTMLHelper. ...

NHibernate, validation logic and AutoDirtyCheck

Here is my scenario: I'm using nhibernate, openning and closing the session in an IHttpModule (PreRequestHandlerExecute and PostRequestHandlerExecute). Ninject takes care of injecting my session in all my repositories and I'm very happy with it. Now suppose an Update to one of my entities (code simplified): Controller: User user = _...

Looking for ASP.NET(MVC, AJAX) Image Manager

Anybody help, I need Image Manager with multi-upload, crop, resize.... And final cost less $150. Maybe somebody using this perfect solution - I want too. ...

How can I get the text of a selected option with ASP.NET MVC?

I have a form in an ASP.NET MVC project which has a select drop down list akin to the following: <select> <option value="ee5711b9-ec86-4378-a975-ae10a4ebedbc">Volvo Account</option> <option value="0dc0e9d8-2245-43de-81a9-5b94c19646fa">Saab Account</option> <option value="f9a05ef6-9ca6-4eeb-9e04-79726a62b38c">Mercedes Account</opti...

LINQ to SQL INSERT Failing

I am experiencing a very frustrating issue when trying to insert a new record using LINQ to SQL. If I step through this code sometimes it inserts the new record but most of the time it doesn't. When it fails I seeing the following error. Cannot insert the value NULL into column 'Name', table 'EquipmentManufacturer'; column does ...

asp.net mvc url routing

How do I map something like domain.com/username? The problem is I think that the MVC routing looks for the controller to determine how it should handle the mapping request. I am pretty new to ASP.NET MVC. However, based on the tutorials so far, the routing mechanism seems rather rigid. ...

ASP.NET MVC - Html.ActionLink<T>(expression)

Is something like Url.Action<TController>(...) or Html.ActionLink<TController>(...) in MvcContrib? I see the FluentHtml stuff for forms, but I don't see the same concept applied to urls. This post on CodePlex said it was added, but I don't see it in the source anywhere. Any help would be great. Edit: Also, I have read this, but wo...

check if user is logged in in user control Asp.net MVC

how can i check if a user is logged in in user control with asp.net mvc usually on a view page i use this <% if (User.Identity.IsAuthenticated) {%> //Do something <% } %> but i can't get this done on a user control ...

ASP.NET MVC: Redirecting to an Action on a different application.

I have a copule of MVC apps. I'd like to be able to redirect from one to another? Do I just post to the specific app I'm trying to hit? Is there a way to Html.RedirectToAction on a different app? ...

asp.NET: Unknown length MVC paths

Hi all, I am building a MVC application in asp.NET for a web portal. I have prepared a series of controllers, and mapped all the paths that don't macth to this to a Page controller, which will render the appropriate page. My default route works like this: routes.MapRoute( "Default", "{level1}/{level2}/{level3}", new { controller ...

How to set startup page for debugging in asp.net mvc aplication?

How to start debugging aplication at aplication root? (http://localhost%3A49742/) I'm always getting the page which doesn't exist like "http://localhost:49742/Views/Home/About.aspx" (it would be ok to start at "http://localhost:49742/Views/Home/About") ...

ASP.NET MVC (Form login): Validation of viewstate MAC failed

Hey Im trying to use ASP.NET login controls, in a ASP.NET MVC project and i get this error, when i click the submit button: Validation of viewstate MAC failed. If this application is hosted by a Web Farm or cluster, ensure that configuration specifies the same validationKey and validation algorithm. AutoGenerate cannot be used in a cl...

How to create new sub domain website using admin panel of existing site

I am developing a site in asp.net MVC, From which a admin can create a sub domain of that site with different css and images but same DataBase. For eg: Suppose I have developed a site www.xyz.com, and admin of xyz.com want to create a sub domain like http://sub.xyz.com/ So when admin put a name of sub domain, Then application create a ...

ASP.NET MVC Architecture

I'm curious about the architecture in ASP.NET MVC. How I should get data from a database? The ASP.NET videos and tutorials shows that all data should be handled in the Models, so I thought this was the way to go. I've started at a new job and here they prefer to get data in the Controllers. What is the most correct way to go? I know th...

How do I automatically include a segment in a url with Asp.Net MVC

Say I have 3 versions of a website: A, B and C. I want my urls to be of the form: {siteType}/{controller}/{action}/{id} where siteType equals a, b or c. When the user is in the A version of the website, then they should stay there; therefore all generated urls should have a siteType of a. Similarly for B and C. I don't want to have ...

Anyone have a Tag Suggestion Component for ASP.Net?

I'm wondering if anyone has seen a tagging suggestion componet for Asp.Net. Simliar to the StackOverFlow, ZenDesk, Delicious Tagging Sugestion (Autocomplete, Click to delete, etc) I'm sure we could put one together...but it seams like it would be prime for a 'Best-in-class' componet product. So I think it must be out there. If not, I'm...

Intellisense <%= intended <%@ Assembly= returned.

When I am editing my aspnetmvc views, I begin my code brackets: <% and intellisense pops up items like <%@ Assembly... <%@ Control... <%@ etc... which is fine, but when I continue my line and press the [=] key, it automatically selects <%@ Assembly=%> and completes my tag. It's not a huge deal, but does slow me down a bit, especia...

Using jQuery To Call A Controller Action

I have a nice page that does everything I need. However one of the elements (a partial page) takes a few seconds longer then I'd like to load. So what I'd like to do is to show the page without this partial first but show a "loading" gif in its place. Then in my jquery... $(document).ready(function() { // Call controller/action (...