asp.net-4.0

Can we use Razor on an existing Asp.Net 4 WebSite?

Is it possible to use Razor on an existing Asp.Net 4 WebSite? ...

How do I use dynamic objects with asp.net?

I have a dynamic object built inside IronPython and I would like to build controls on my asp.net page dynamically based on what types of objects are nested inside my dynamic object: dynamic variousComplexObjects = IronPythonApp.GetControls(); repeater.DataSource = variousComplexObjects; repeater.DataBind(); Can someone write me a quic...

In .NET 4.0 do you still need to handle gridview paging in code?

I haven't worked on the UI in some time. I thought that in ASP.NET 4.0, gridviews handle the paging automatically (if you set paging=true). Is this true, or do you still have to handle it in code? ...

Does asp.net 4.0 webforms have url and form databinding?

I am not sure what this is called. If know know what it's called you can edit this post. asp.net mvc allows you to do this: public ActionResult Index(FormCollection fc) { Item.Add(fc); return View(); } It is nice that in MVC the FormCollection object is automatically populated with the relevant data. Is there anything like ...

How to redirect to pre-defined error page?

I have error page settings in my web.config like: <customErrors mode="RemoteOnly" defaultRedirect="ErrorDocs/500.htm"> <error statusCode="404" redirect="ErrorDocs/404.htm"/> <error statusCode="403" redirect="ErrorDocs/403.htm"/> </customErrors> Is there a simple way to redirect to 404 page without typing its name? Ex: Response...

Why is using a URL containing a colon considered as a "potentially dangerous request"?

Someone (probably a bot) sent a request with the following URL to my ASP.NET 4.0 web forms application (running on IIS 7.0): http://ipaddress-of-my-applications-domain/bla1.bla2.bla3.bla4.bla5:) This caused an System.Web.HttpException. I received a logging email from ASP.NET HealthMonitoring I had configured, telling me: A potentially...

How can I programmatically remove impersonation in ASP.Net?

I have in my web.config, is there any way to programmatically "unimpersonate"? There is just one or two little places where I need to not be impersonating... is this possible? ...

Setting X-UA-Compatible meta tag in ASP.NET 4.0 site doesn't work

As I understand it you can tell the IE8 (and I assume later versions) how to best render your page. This is useful because the page may have been designed for IE7, quirks mode or to target IE8 standards mode. As I have it, the default behaviour for IE8 when it encounters a page is to render in IE8 standards mode (not sure how it interpr...

Visual Web Developer Express 2010 doesn't save changes made to contents of Ajax Toolkit Tab Container in design view

When editing the contents of an AJAX Control Toolkit Tab Container in VWD Express 2010: Sometimes the changes are saved ok, sometimes extremely slowly & sometimes not at all. A "page changed" asterisk in the name tab of the page appears briefly, but then disappears again. Does anyone know anything about this, please? Thanks! Vlad ...

WCAG 2.0 Support In ASP.NET 4.0

Have there been any improvements to aid accessibility standard compliance in ASP.NET 4.0? (WCAG 2.0 in particular) ...

Is it possible to turn on HTML encoding by default in ASP.NET 4?

In ASP.NET 4, we can use the new <%: ... %> operator to output HTML encoded strings. Is it possible to configure ASP.NET 4 (in web.config) so that the <%= ... %> operator will also HTML encode strings? ...

Why "Membership" section doesn't appear in the Web.config?

Hello.. ASP.NET 4.0 and C# I'm using the default membership provider with the SqlExpress DB that the ASP.NET had created for me, but I want to modify some settings. so I went to the web.config file to search for the and to change setting there, but I didn't find them! I don't want to create a new provider. I just want to modify the...

.net 4 xslt extension objects

Hi, I'm in the process of upgrading an asp.net v3.5 web app. to v4 and I'm facing some problems with XSLT transformations I use on XmlDataSource objects. Part of a XSLT file: <xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform" xmlns:ExtensionObject="ds:ExtensionObject"> <xsl:output method="xml" indent="ye...

Binding RadioButtonList to List<T> and setting DataValueField Proprty

Hello.. I have a class called "Answer" includes: int ID; String Text; And I have a list of them like this: List<Answer> myList; in the web page, I have RadioButtonList that I want to bind data from the list above, so I've done: AnswersButtonList.DataSource = myList; AnswersButtonList.DataTextField = "Text"; AnswersButtonList.Da...

ASP.NET 4 security-transparent code level2 exceptions

Hi, I'm having trouble with the new .NET 4 security-transparent code, level 2. I'm upgrading my ASP.NET 3.5 web application which uses XSLT with Extension Objects. In .NET 4 the transform causes a SecurityException, after lots of research it appears this exception has to do with the new transparent code, level 2. As a fix I now have t...

ASP.NET 4 web.config transformation MSBUILD

Hi, I want to use the newly introduced web.config transformation options in VS2010. But I'm not using the Deploy option of VS2010, i'm using Web Deployment Projects with MSBUILD tasks. Can I apply the transformation with an MSBUILD task? ...

ASP.NET 4 migrate to routing / mapping

Hi, Previously I was using Rewriter.net to rewrite my urls. I used a format like: <rewrite url="~/(.*)_p(\d+).aspx\??(.*)" to="~/product.aspx?pid=$2&amp;$3"/> So a page url would look like ~/productname_p21.aspx with an optional querystring. I'm upgrading the application to ASP.NET 4 and I would like to use the URL routing in System...

ASP.NET 4.0 - Hosting a ReportViewer control inside a Web Part control

Hi, I have a series of reports designed in Reporting Services that I'd like to make available through a single ASP.NET web page. I plan to make the reports available via the ReportViewer control. Unfortunately we don't have SharePoint available and my company isn't looking to buy it - so I'm stuck (I believe) with this method. Is it po...

ASP.NET 4 Deployment MSBUILD

I'm using VS2010 with the Web Deployment Projects to create a release package for my web application. In WDP I have created some build tasks to for example transform the web.config, create some directories and remove some files. Now I've migrated the web application to ASP.NET 4 and I've been looking at this feature in VS2010 called Pac...

How to use a custom IoC in asp.net website?

I am trying to write a simple IoC library, and i am going to use it in asp.net websites. My Question is: Should i cache all the registered objects "i add this in Dictionary<Type, object>" and use the cached objects each request? ,or should i resolve them each time page loads or on a new request? And does the exist tools such as unity ha...