asp.net-mvc

need solution for split cell value (string) and view this as link in VIEW in ASP.NET MVC 1 project

In my table i have: id, header, centent and foto columns. In foto column are cells included string values for egxample :(foto1.jpg,foto2.jpg). J split this and the result input to table. I'm trying to view this in Details.aspx. I must view one record from table in my database plus one split cell as links. View the hole record is not the ...

Page redirecting before SQL has excuted - ASP.NET MVC

I have a slightly modified AccountController that should write a row into a table upon login. However, the page redirects before the DB action has completed and so nothing is inserted. I've temporarily solved this by sticking in a Thread.Sleep, but I'm looking for an alternative that makes it appear seamless. If Not String.IsNullO...

json with complex objects or asp.net partialview/partialresults

if i have a div or a partialcontrol and i have link that i want to click that will refresh the div, it seems like i can: use ajax.beginform or ajax.actionlink and return PartialResult() use jquery to post/get/ajax and return json if i have a big complex object that i am binding to my view, which option is better. it seems like for #...

Want any alphanumeric and underscore, dash and period to pass

In my controller, I current set a constraint that has the following regex: @"\w+" I want to also allow for underscore,dash and period. THe more effecient the better since this is called allot. any tips? ...

TempData from Global ASAX

Can someone post a sample code on how I can access the TempData dictionary object from within the Global.asax.cs. Thanks in advanced... ...

Best way for creating reports in ASP.NET MVC

Hi, After building my application in ASP.NET MVC and MS sql server, I would now like to display some statistics regarding my data. What would be the easiest way to create HTML reports which are built of data crossing several tables? (Once the fields are picked they'll be static, meanning a single view is required) I though their ough...

ASP.NET MVC saving Entity session

Hi, I have been working with entity framework and ASP MVC for a while. I have stored the entity object in the HttpContext.Current.Session in order to use the same session at all times. Now I have encountered some problems and I am wondering if this may have been a bad idea and if so, how should I do it otherwise. The problem I have now...

Which Javascript history back implementation is the best?

There are implementations for history.back in Micrososft AJAX and jQuery (http://www.asual.com/jquery/address/). I already have jQuery and asp.net ajax included in my project but I am not sure which implementation of history.back is better. Better for me is: Already used by some large projects Wide browser support Easy to implement Li...

Semi-colon expected... but there is one, any MVC.NETers can look at this?

Compiler Error Message: CS1002: ; expected Source Error: Line 56: </div><!--end #Asset--> Line 57: Line 58: <% KODmvc.Models.AssetRatingViewModel ratingModel = ViewData["RatingViewModel"] as KODmvc.Models.AssetRatingViewModel(); %> Line 59: <% Html.RenderPartial("RatingView", ratingModel); %> Line 60: Source Fil...

How to have generic routes in ASP.NET MVC, but handle unknown actions?

If I have a route: routes.MapRoute( "RouteName", // route name "{action}", // url with parameters new { controller = "Home", action = "Index", id = "" } // parameter defaults ); I want to be able to catch URL's of the form: http://site...

Asp.NET MVC and security

Hi, I am planning a new portal solution in ASP.NET MVC. I need to be able to have some parts of the site visible for everyone (public part) and a part where only registered users are allowed to visit. In traditional Web Forms the security was made on folder level, but how about ASP.NET MVC? Could someone please explain me how to do this ...

asp.net MVC RenderAction coordinator

We're looking at the ASP.NET MVC 2 beta RenderAction() method. We like it very much but it seems that we can't use async controllers with it. Does anyone have an example of a "controller" that can figure out all the actions that will be called, cache the data, then let the called actions know that their data already exists vs. having ...

ASP.Net MVC Error Validation - How to display validation message when passing a custom view model to a view

I have been adding error and business validation to my app, and when I test using a view that was strongly typed to one model, let's say locations, I get the validation summary as well as the validation messages for each field that didn't pass, plus my css highlights the appropriate field as expected... ...when I try this with a view th...

unit testing asp.net routes

is there a way to test routes via nunit? ...

when unit testing an asp.net controller, where do you mock the httprequestbase?

when unit testing a asp.net controller, don't you have to somehow mock the httpcontextbase? All my controllers inherit from a custom controller class that I wrote (it just adds some common properties to the original controller class). So its like: public class MyController : Controller { protected override void OnActionExecuting(Sy...

Best practices for minimizing ASP.NET MVC inline code (tag soap)?

I am an experienced ASP.NET WebForm developer and trying to learn MVC. I am still not too excited about MVC because of the inline code process. At some point I can't see the HTML from all the code and I have to render the page and do a view source. I know you can swap out the view engine and was wondering about two things: 1- Is there...

Sample application highlighting the new features of ASP.NET MVC v2?

Is there a good full sample application which highlights the new features of ASP.NET MVC v2 (as opposed to the initial release of ASP.NET MVC)? ...

Best resources & books for ASP.NET MVC Framework

Possible Duplicates: Good asp.net mvc (VB) books Best ASP.NET MVC book? Best resources & books for ASP.NET MVC Framework ...

Static content in ASP.NET MVC in IIS 7

Hello, I have ASP.NET MVC 1.0 application (.NET 3.5) running on II7 and Windows 2008 Server. The application is deployed in 'Integrated Pipeline' mode. In Global.asax.cs I added: public void Application_EndRequest(Object sender, EventArgs e) { //print URL } The method is being called even for static content (images,css,js) in /Conte...

ASP.NET MVC User Messaging Implementation

Ok, let's say your view has four partials (each with seperate viewmodels) that are all tied to the main viewmodel. You hit submit and all your data posts up. You run some server side validation and you notice that validation errors occured in fields in 3 of the 4 partials. So, I want to post back the validation errors but above the pa...