Any way to clear/flush/remove OutputCache?

You can use the VaryByCustom parameter for this. In your user control you would have the following: <%@ OutputCache Duration=”1000″ VaryByParam=”None” VaryByCustom=”MyKey” %> Then you would override the GetVaryByCustomString method in your Global.asax like so: public override string GetVaryByCustomString(HttpContext context, string arg) { if (arg == “MyKey”) { object o = context.Current.Application[“MyGuid”]; if (o == … Read more

MSCharts “No http handler was found for request type ‘GET'” error

This is what you need for ASP.NET 4.0 / IIS 7.5 on Windows 7: Your web.config must contain the following: <appSettings> <add key=”ChartImageHandler” value=”storage=file;timeout=20;” /> </appSettings> <compilation targetFramework=”4.0″> <assemblies> <add assembly=”System.Web.DataVisualization, Version=4.0.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35″/> </assemblies> </compilation> <system.webServer> <handlers> <add name=”ChartImg” verb=”*” path=”ChartImg.axd” type=”System.Web.UI.DataVisualization.Charting.ChartHttpHandler, System.Web.DataVisualization, Version=4.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35″ /> </handlers> </system.webServer> You also need this at … Read more

IIS AAR – URL Rewrite for reverse proxy – how to send HTTP_HOST

This post has the answer – Modifying headers with IIS7 Application Request Routing Need to enable preserveHostHeader – can’t see how you do that in the UI but this works Run this from command line to update Machine/webroot/apphost config %windir%\system32\inetsrv\appcmd.exe set config -section:system.webServer/proxy -preserveHostHeader:true /commit:apphost

SelectedValue which is invalid because it does not exist in the list of items

Apparently the solution I posted wasn’t entirely effective… Eventually in my application I changed to this: listOrgs.Items.Clear(); listOrgs.SelectedIndex = -1; listOrgs.SelectedValue = null; listOrgs.ClearSelection(); // Clears the selection to avoid the exception (only one of these should be enough but in my application I needed all..) listOrgs.DataSource = new Organization().DTListAll(SiteID); listOrgs.DataTextField = “OrganizationName”; listOrgs.DataValueField = … Read more

Web API Queryable – how to apply AutoMapper?

Use the AutoMapper’s Queryable Extensions. First, define the mapping. // Old AutoMapper API // Mapper.CreateMap<Person, PersonDto>(); // Current AutoMapper API Mapper.Initialize(cfg => cfg.CreateMap<Person, PersonDto>() ); Then you can use something like this: [EnableQuery] public IQueryable<PersonDto> Get() { // Old AutoMapper API // return this.dbContext.Persons.Project().To<PersonDto>(); // New AutoMapper API return this.dbContext.Persons.ProjectTo<PersonDto>(); } Edit 04/2019: Updated to … Read more

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)