asp.net-4.0

Response.Redirect doesn't work in .net 4

where used on http://localhost:8692/Contacts/Default.aspx Response.Redirect("http://www.google.com") redirects to http://localhost:8692/Contacts/http%3a%2f%2fwww.google.com The problem just appeared once I upgraded to .Net 4 Edit: Response.Redirect("~/Contacts/MemberDetails.aspx?Id=3") goes to http://localhost:8692/Contacts/%2fContacts...

ASP.NET MVC 2 + LINQ to SQL - CS0012 Compilation Error

Hi, In my database schema each forum has a category and categories can have many forums. I'm trying to list categories and their respective forums with the following code: <%@ Page Title="" Language="C#" MasterPageFile="~/Views/Shared/Site.Master" Inherits="System.Web.Mvc.ViewPage<dynamic>" %> <asp:Content ID="Content1" ContentPlaceH...

ASP.NET 4.0 MVC2 routing on IIS 6

ASP.NET 4.0 MVC2 routing on IIS 6 is not working for me with all the methods used for 3.5 Works fine as long as I build in 3.5 but building in 4.0 and setting the server to use 4.0 I loose my routing. Anyone seen this and been able to resolve it? ...

How to define using statements in web.config?

I'm using MySql in my asp.net project. But I don't want to type every "using MySql.Data.MySqlClient;" statement in every aspx.cs/aspx.vb file. How can I define this lines in web.config file? I've defined some namespaces like below but this only works for aspx pages: <?xml version="1.0"?> <configuration> <system.web> <compil...

How to enable 'Add Config Transforms' for old Visual Studio 2008 project?

I am working in the new Visual Studio 2010 RTM and I would like to use web.config transforms. My site is configured to use .NET 4.0 but it was formerly a Visual Studio 2008 web application project. When I right-click on my web.config file I do not see the 'Add Config Transforms' option as I should. I also tried adding creating a new w...

[OutputCache] for a function in .net 4

Hi, I read at Scottgu blog about using OutputCache for a function but this didn't worked for me. How can I use [OutputCache(Duration=60)] for a function and can I add VaryByParam in this statement? Which namespace is required? ...

Exclude routing parameters in VaryByParam for Asp.Net 4

I have a routing setting in my global.asax file: routes.MapPageRoute("video-browse", "video/{id}/{title}/", "~/routeVideo.aspx"); My routeVideo.aspx page has caching setting: <%@ OutputCache Duration="10" Location="ServerAndClient" VaryByParam="id" %> But when I request http://localhost/video/6/example1 and http://localhost/video/6...

problems with correct update to .net 4.0 on win2003

Tried to test .net4rc1 site on test host with win2003. As expected by default server returned error about " targetFramework="4.0" in web.config. But since I switched ASP.NET version to 4.0 and reboot that site just returning 404. Whats wrong?) ...

Why is my asp:Substitution control suddenly not working in ASP.NET 4.0?

I just upgraded my site from ASP.NET 3.5 to 4.0. I've been working through some breaking changes and there were more than I expected. One I can't figure out, however, is why my <asp:Substitution /> control suddenly stopped working like it should. It's supposed to ignore the output cache settings of the parent page and update upon ev...

ValidateRequest="false" doesn't work in Asp.Net 4

Hi I have a form at which I use ckeditor. This form worked fine but now doesn't work in Asp.Net 4. Any suggestions? I have ValidateRequest="false" directive. ...

Is there a better way to share master pages now that VS 2010 and .Net 4 are out?

I'm trying to find a better way to share a master page than the old method of using Web Deployment Projects and a really nasty master page to share master pages between applications. I would think Microsoft would have given us something a little nicer in 2010, but I haven't found anything. Any ideas? ...

Should I still use querystrings for page number, etc, when using ASP.NET 4 URL Routing?

I switched from Intelligencia's UrlRewriter to the new web forms routing in ASP.NET 4.0. I have it working great for basic pages, however, in my e-commerce site, when browsing category pages, I previously used querystrings that were built into my pager control to control paging and now am not sure how to handle this using routing. I de...

LazyList<T> vs System.Lazy<List<T>> in ASP.NET MVC 2?

In Rob Conery's Storefront series, Rob makes extensive use of the LazyList<..> construct to pull data from IQueryables. How does this differ from the System.Lazy<...> construct now available in .NET 4.0 (and perhaps earlier)? More depth based on DoctaJones' great answer: Would you recommend one over the other if I wanted to opera...

ASP.NET: images broken when combining URL Rewriting, asp:ImageButton and html base tag

Hi, I'm using URL Rewriting under ASP.NET 4 (using ISAPI_Rewrite) and I'm finding that that some of my images are not loading as .NET does not seem to understand I'm using an html BASE tag (pretty standard and essential when doing URL Rewriting): eg in my development environment I have: <base href='http://localhost/venuefinder/Website/...

asp.net 4.0 web forms routing - default/wildcard route

I there a simple way when using ASP.NET 4.0 routing with Web Forms to produce a route that will act as some kind of wildcard? It seems to me that within WebForms, you have to specify a route for every page - I am looking for some kind of generic route that can be used where nothing specific is required, perhaps mapping directly from pat...

Unable to use IIS7 with Visual Studio 2010, MVC2.0 and NET4

Here is my environment Windows7, Visual Studio 2010, MVC2.0 and NET4 My default web site is configured to use ASP.NET v4.0 application pool. Here is an easy way to reproduce my problem Create a new MVC2 application Open the properties Window Go to the Web tab Check "Use IIS Local Web Server" Click on "Create Virtual Directory" button ...

asmx web service returning xml instead of json in .net 4.0

i have just upgraded a test copy of my site to asp.net 4.0 and have noticed a strange issue that only arises when i upload the site to my server. the site has an asmx web service that returns json, yet when i run the site on my server it returns xml. it as been working fine in asp.net 3.5 for over a year. the webMethod is decorated wi...

ASP.Net 4.0 - Response required in SiteMap building?

I'm running into an issue upgrading a project to .Net 4.0...and having trouble finding any reason for the issue (or at least, the change causing it). Given the freshness of 4.0, not a lot of blogs out there for issues yet, so I'm hoping someone here has an idea. Preface: this is a Web Forms application, coming from 3.5 SP1 to 4.0. In ...

Where Are the Release Versions of ASP.Net AJAX 4.0 Templating Files?

I'm trying to get the release version of ASP.Net AJAX 4.0 Templating working and can't find the JavaScript files. With the beta version I needed to reference MicrosoftAjaxTemplates.js, MicrosoftAjaxAdoNet.js, and MicrosoftAjaxDataContext.js. I can get everything to work with the beta CDN versions (e.g. http://ajax.microsoft.com/ajax/...

ASP.NET 4.0 webforms routing

I have an existing site that I'd like to convert to use routing, and after reading Scott Guthrie's post here, I built a working sample that works for most circumstances. However, since not all of the pages on the existing site match a particular pattern, I'll need to check against a database to determine which route (destination .aspx ...