asp.net-mvc

CSS: Possible to define styles mid way through an html document?

In ASP.NET MVC, there are these snippets of html called view templates which appear when their matching data appears on the screen. For example, if you have a customer order and it has a vendor address, the vendor address view template shows up populated with data. Unfortunately, these don't have access to "MasterPages" nor are aware o...

Inline HTML Syntax for Helpers in ASP.NET MVC

I have a class that extends the HtmlHelper in MVC and allows me to use the builder pattern to construct special output e.g. <%= Html.FieldBuilder<MyModel>(builder => { builder.Field(model => model.PropertyOne); builder.Field(model => model.PropertyTwo); builder.Field(model => model.PropertyThree); }) %> ...

Redirecting to parentpage using an Iframe with a form

Working in ASP.NET MVC 2. I have a page that opens a Iframe. On that IFrame I have a form. When I click submit I redirect to a controller. How can I show the result of that controller on the parent page and not in the IFrame? ...

"404 Not Found" error in mvc

i am using asp.net mvc 2.0. in that i am using partial views but whenever i clicked on particular link i get the follwing error 404 Not Found can any one konw the solution the application run properly at local host but it shows the error when i uploaded on the server. thanks. ...

ASP.NET MVC Authentication Cookie Not Being Retrieved (UPDATED)

I am having a hard time implementing "Remember Me" functionality in an MVC application with a custom principal. I have boiled it down to ASP.NET not retrieving the authentication cookie for me. I have included a snaphot below from Google Chrome. Shows the results of Request.Cookies that is set within the controller action and placed in...

Routing & URL generation issue with optional parameters

Hi all, I've a small issue with URL generation & routing under ASP.NET MVC 2. My route has optional parameters and the URL is correctly generated if the parameters are specified. Thus: routes.MapRoute("Blog", "Articles/{tag}/{page}", new { controller = "Blog", action = "Index" }); with: <%: Html.ActionLink(item.Tag, "Index", "Blog"...

IIS cannot serve pages ending with .config

This is obviously a security issue and probably do not want to change this, but it would be nice to handle the error. Any ideas? I see that stackoverflow is not immune: http://stackoverflow.com/questions/tagged/web.config They seem to have changed the tag to web-config to fix the problem but you still get a very nasty error message wh...

Time to start a counter on client-side.

Hi everybody, I'm developing an web application using asp.net mvc, and i need to do a stopwatch (chronometer) (with 30 seconds preprogrammed to start in a certain moment) on client-side using the time of the server, by the way, the client's clock can't be as the server's clock. So, i'm using Jquery to call the server by JSon and get the ...

Could not load file or assembly 'Data' or one of its dependencies. Access is denied.

I am trying to run the my asp.net mvc project on IIS 7 , I am trying to impersonate the user. Where Data is the data project of my application, i have added the dll reference to the asp.net mvc project I tried giving full control to very one to this folder C:\WINDOWS\Microsoft.NET\Framework\v2.0.50727\Temporary ASP.NET File. Any clue ...

Asp.NET MVC 2 Routing

I want to define a route that have 2 optional parameters in the middle of the URL the start an end parameters are digits routes.MapRoute( "", "Source/Changeset/{start}/{end}/{*path}", new { controller = "Source", action = "Changeset", ...

Browser freeze while ajax call in action

I have a ASP.NET Web App. I notice that while a simple ajax call(see below) is in process, web application does not respond to any action that I try on a different browser. $.ajax({ type: "GET", async: true, url: "someurl", dataType: "text", cache: false, success: function(msg){ ...

if all my views are passed a strongly typed viewdata, if they have a baseviewdata class, can I set a property in onexecuting?

I want all my views to inherit from a baseview data so I can set some shared properties that all my views will need. Can I set some properties in OnExecuting so I don't have to do it for all Actions? I want to then display the string value of the property in all my view pages. If yes, how can I do this? I need to hook into the base v...

ckeditor integration with asp.net mvc

how will i integrate ckdeditor with asp.net mvc ...

how to make a session persistent with .net

Is there a way to set a persistent session that would not expire when closing/re-opening a browser. The cookie that is used to store the session_id expires when the browser is closed. I know we can make the Auth persistent (stay logged in when we close and re-open a browser). In this case, the cookie does NOT expire when the browser is ...

In MVC (Asp.Net MVC specifically), should a model be represented by a single view?

To me, this seems to make little sense, but after reading the information in the following: http://weblogs.asp.net/scottgu/archive/2010/02/05/asp-net-mvc-2-release-candidate-2-now-available.aspx http://bradwilson.typepad.com/blog/2010/01/input-validation-vs-model-validation-in-aspnet-mvc.html http://blog.stevensanderson.com/2010/02/19...

inbound/outbound url routing in asp.net MVC

The routing I need is quite simple, I must be missing something there. As code example I put the simpler situation where I can reproduce my behavior. You have this ActionMethod : public ActionResult Index(string provider) { ViewData["Message"] = provider; return View("Index"); } And you have this route : routes.MapRo...

Can't select View Content dropdown when adding view in MVC using Interfaces

I have my Model defined externally in two projects - a Core project and an Interface project. I am opening the Add View dialogue from my controller, and selecting Create a strongly typed view. In the drop down list, I can select the concrete types like MyProject.Model.Core.OrderDetails, but the interface types like MyProject.Model.Int...

MVC 1.0, .Net 4.0, and Expression Blend 4

I am trying to open a MVC 1.0 project compiled with the .net 4.0 framework in Expression 4. The solution opens fine, but there is no intellisense and when I run it, it shows an html browse page with the files listed. Any ideas on how to get Expression 4 to play nice with MVC? Thanks ...

ASP.NET Possible to feed a single content placeholder from multiple places?

Is it possible to feed a single Master Page Content Placeholder from multiple areas in the child page? Something like a string builder? ...

ASP.NET MVC 2 View (ViewModel) -> MS Word or PDF Generation?

Id like to have my mvc 2 app generating reports in both MS Word and PDF formats....currently working on Word. I found this: http://www.revium.com.au/articles/sandbox/aspnet-mvc-convert-view-to-word-document/ Which i think basically streams the view output from a controller action to a word document.... public ActionResult DetailedRe...