asp.net-mvc

Ways of keeping model values that are not submitted on post in ASP.NET MVC?

When I have a Model or ViewModel with values that are sent from the controller to the View but rendered in such a way that they are not submitted back to the controller when a form is posted, (e.g. a label whose contents is loaded from a data source) what is the preferred way to make those values available to the controller action that h...

When a url results in a temporary redirect (http 302), what gets indexed?

I'm trying to make our (very heavily AJAX based) website more search engine friendly. We have a system where certain urls redirect to the main page after setting session variables to change the behavior of the main page. This is acheived using the Controller.Redirect method to create an ActionResult. So for instance, the main page is: ...

MVC: How to route /sitemap.xml to an ActionResult?

Hi, I've got a SitemapActionResult that overrides the ActionResult, and delivers a SEO sitemap.xml when http://www.sprelle.no/Home/SiteMap is hit. So far so good. What I would like, though, is to serve the sitemap.xml when Google visits /sitemap.xml. For that to work, I need a route that sees "sitemap.xml" and directs to /Home/Sitemap. ...

Master-Detail with jqGrid+Asp.Net MVC and transaction

Hi, I'm coming from the delphi world and I want to make a master/detail interface, like Order and Products. I already made actions to display the data using fields and a jqGrid. What I want know is how make possible to add lines, edit or remove them, but, just make the changes in db when the user confirm the changes in the master. On del...

asp.net MVC Url.Content() CDN redirection

I'm wondering if there's an easy way to specify a CDN for all content that I reference through Url.Content in my views. Something that I could configure in my Web.config file in a way similar to the following. <cdn> <add filetype="css" root="http://mycdn.mydomain.com/stylesheets/" /> <add filetype="js" root="http:/...

LINQ-NHibernate - Selecting only a few fields (including a Collection) for a complex object

I'm using Fluent NHibernate in one of my projects (and ASP.NET MVC application), with LINQ to query to data (using the LINQ to NHibernate libraries). The objet names are changed to protect the innocent. Let's say I have the following classes Foo, Bar, Baz, and their appropriate tables in the database (MySQL). Foo has a many-to-many re...

Could not load file or assembly error in ASP.NET when IIS server is idle

Hi, I am using ASP.NET MVC technology to create a website. The site is hosted on IIS 7 server. If the site is not accessed for a while i get the "Could not load file or assembly error " . The error disappears after a single page refresh. I know the DLL is formed as part of project structure automatically by Asp.Net MVC Model. FS is the...

MVC - Routing not working within intranet

Hi, I don't know anyone can help but I'd appreciate any. I am developing an app in mvc (c#), now I had various routes working on my local development machine when the app was stand alone however now I've tried adding the project to the test intranet at work and none of the routes are working. So where Localhost/Admin/Create worked fine...

Getting an exception trying to upload and save a file upload on remote server but local box is fine

i have an asp.net mvc app that has a form that uploads a file. On my local box, of course it works fine but when i run it on a remote webserver i get this error: Exception Details: System.UnauthorizedAccessException: Access to the path 'C:\directory\mytestfile.csv' is denied. ASP.NET is not authorized to access the requested resource....

C# Model Validation - Validation Application Block or DataAnnotations?

I want to add validator attributes to my domain models (in an ASP.NET MVC app), and I'm trying to decide between 2 frameworks, the Validation Application Block and DataAnnotations. They appears to do similar tasks, so I want to pick the one which will be the most supported/used in the future. It seems DataAnnotations are newer (and built...

any way to check both request.form and request.querystring in a single call?

Is there a built in collection that checks both request.form and request.querystring ...

How can I have an SSIS job communicate with my ASP.NET MVC site?

When a certain thing happens in an SSIS job I have running, I need it to send internal messages out to users. What is the easiest way to setup my ASP.NET MVC site so my SSIS service can call some action on the site and pass in a few string parameters (recipients, etc). Should I try and use a traditional web service, or WCF service, or ...

Recommendations for learning ASP.NET MVC from a desktop developer's perspective.

One of my New Year's Resolutions is to finally learn some web development. I've decided on ASP.NET MVC as I'm a believer in TDD and IoC. I'm looking for a list of topics and perhaps an order to learn them for what I'll need to know to be a solid ASP.NET MVC developer. Perhaps this is embarassing, but the only web experience I have was...

How do I return a FileResult in ASP.NET without knowing the MIME type?

My ASP.NET MVC application has pages with attachments and these attachments can be of many different file types. When the user then wants to access their attachment, I need to fire off an FileResult and return the file attachment which I have the path to. However, I have no database of mime-types, nor do I know off-hand the mime-type o...

ASP.NET MVC and Providing Third-Party API

I'm developing a web app. This is more of a line-of-business app rather than a web site. I'm using ASP.NET MVC, SQL Server 2008, and I've purchased LLBLGen. I need to provide an some sort of API to third parties. For instance, if this was a medical app, third parties might need to CRUD patients, retrieve complex reports, engage certain k...

HtmlHelper is null in Error.aspx master page

I have a custom Error.aspx page in my ASP.NET MVC application. The error page uses a master page (which in turn uses another master page), and in the master page there is a call to HtmlHelper: <%@ Page Language="C#" MasterPageFile="~/Views/Shared/Unsecure.Master" ... %> ... Html.RenderPartial("LogOnUserControl") My web.config is set ...

How do I initialise a silverlight control without using web service call

I am developing an asp.net mvc web application that makes much use of jquery and the progressive enhancement principle. I have a requirement for a complex control that needs access to .net code in order to function (using reflection across numerous classes). The choices were to duplicate this code in javascript (auto-generate if possibl...

ASP.NET MVC and ModalPopupExtender

I am developing an application with ASP.NET MVC and wish to make use of Modal style windows. Here is one example. On my "Login" view, I have my login details, but also have a button to create an Account for the application. I have a separate "CreateAccount" view, but would like it to pop up inside a ModalPopupWindow. Is this possible ...

How to catch an error that isn't even caught by the OnException override?

So we have a base controller we are using and it contains an override for OnException that logs the error to our bug tracking tool. However I noticed that some errors never make it, and I'm wondering if it is somehow silly to expect an application to log all it's own errors when itself is the thing that is having an error, which could ca...

asp.net mvc - how to update dropdown list in tinyMCE...

Scenario: I have a standard dropdown list and when the value in that dropdownlist changes I want to update another dropdownlist that exists in a tinyMCE control. Currently it does what I want when I open the page (i.e. the first time)... function changeParent() { } tinymce.create('tinymce.plugins.MoePlugin', { creat...