by Dominic Zukiewicz
7. June 2010 14:42
The AuthentiX FAQ gives information on how to make AuthentiX the application work with IIS 6 sucessfully, but applying this fix, the site has not worked regardless of the change specified. Since the current version used is out of support, and the client is looking to upgrade to Forms Authentication, I had to make do with the problem. Over the weekend, I had to fix an issue where IIS 6.0, whilst running in IIS 5 Isolation Mode, suddenly (possibly due to a Windows Update) completely crashed IIS, so that it was unusable. IIS 6 kept coming up with the error “The path for the specified directory c...
[More]
by Dominic Zukiewicz
7. June 2010 14:23
One of our clients use a 3rd party authentication tool called AuthentiX, which allows directory level authorisation and the use of multiple data sources to be used for IIS. Although ASP.NET has Forms Authentication, AuthentiX has been in use by the client for over 10 years and so co-existence with ASP was required to allow the retrieval of the username. Its usage is quite simple. If the code is executing on your page, they have been authenticated (or have they?) and given access to it. A code snippet of this COM component looks like this: protected void Page_Load(object sender, Event...
[More]
by Dominic Zukiewicz
12. May 2010 11:09
I was continuing to help migrate some ASP code into .NET. My task this time was to bring the remaining part of the frameset (no, not using Master Pages yet), into .NET. So we have 3 parts: A Frameset page (ASP) Navigation (.NET) Content (.NET) Footer (.NET) But something odd was happening. When the first page request came in, 3 Global_asax.Session_Start events were generated. This caused major problems, as the frames all used the UserId , via the Session. BUT 3 Sessions were being created, and therefore not sharing any new data that went into it. The reason this was happeni...
[More]
by Dominic Zukiewicz
20. April 2010 10:48
Now many people will argue that it is a stupid idea to store clear text credentials in web.config, and in some respects they are right. Obviously the credentials for the website is as clear as day, BUT .config files are not served by ASP.NET, so there are some precautions in place. But if you are writing a test app for the Membership provider and you really can’t be bothered with setting up a SQL Local Data Source and really just want to get your proof of concept out of the way, it really is brilliant. However, although you normally set up Membership once per project, I became a little bit r...
[More]
by Dominic Zukiewicz
24. March 2010 09:29
One problem we have been encountering for nearly a year is a problem which reports ASP.NET errors, but actually does not cause any problems for the user. The error looks like this:
** Events **
---------------
Event code: 3005
Event message: An unhandled exception has occurred.
Event time: 3/23/2010 11:44:44 AM
Event time (UTC): 3/23/2010 11:44:44 AM
Event ID: 6be66d016f1e43b48adbd638e202c698 Event sequence: 3548 Event occurrence: 1 Event detail code: 0
Process information:
Process ID: 7872
Process name: aspnet_wp.exe
Account name: WEBSITE\ASPNET
Exception informat...
[More]
by Dominic Zukiewicz
26. February 2010 10:29
Nothing to complex this time, just for reference really. Sometimes you want a simple button to just go back to the previous page. All you need is: <asp:Button runat="server" Text="<%$Resources:MyResources,Back%>" OnClientClick="javascript:history.back(); return false;"/>
The reason I'm using an ASP.NET Button is purely for the Localization functionality, so you can use with with HTML controls as well
by brad
26. January 2010 11:15
FindControl() is great if you’re looking for a control one level down, but if you’re making a dynamic control with n levels of child controls it can become a pain… Extension Methods to the rescue! Not only does it find the control your looking for at any level in the page, it also used generics to return the control without needing to cast it. /// <summary>/// Finds the control (Recursively) with an ID matching that given, of the Type requested. /// No need to cast either!/// </summary>/// <typeparam name="T">The type of control to return</typeparam>///...
[More]
by matt
27. November 2009 17:24
I’ve been looking in to MVC a fair bit recently (more specifically Microsoft’s implementation) and came across this article about Dependency Injection by Mike Brind. Well worth a read as it explains the concept very well if you’re not familiar with it.
by matt
30. June 2009 16:06
I’m sure that, like a lot of people working with EPiServer I have a play area that I use to try things out and start off any proof of concept work that I’m going to be implementing later on in various projects. For this, I use the SDK Installation of EPiServer CMS along with an instance of the Visual Studio Web Server when my laptop boots up so that it’s always running.
Today, I wanted to have a play with Composer with a view to knowing enough about it to be able to get sign-off some projects that can use it. First thing is just install it and see what happens. There were some pretty good...
[More]
by matt
12. June 2009 15:51
Bah, I just found a much quicker and much simpler way of reading RSS while reading Mats Hellström’s blog article about Aggregating Feeds on the EPiServer Blogs.
Mats is talking about taking multiple feeds and adding them together, I’m still really only interested in on. The key point I took from his blog is the SyndicationFeed class and all of its pals from the System.ServiceModel.Syndication namespace. This makes most (read that as all) of my previous post on the subject pretty much irrelevant, as this is all nicely handled for us.
The code blow shows how I might do somethign similar to t...
[More]
9d3f3399-e0a5-4cc9-a146-bb38ad9bf38d|0|.0
Tags:
ASP.NET
by matt
9. June 2009 12:50
I was recently working on an EPiServer solution and the client wanted to include an RSS feed on certain pages of their site. I though I would write out here how I consumed the feed. You’ll want to add error handling etc in here, as this is as rough as a tramps beard whilst being enough for you to get the point. The first thing I had to do was to find out how RSS is structured. After a little Google search I found an article explaining the structure of RSS in sufficient detail for me to continue. The first thing that I did was create a struck to contain the configuration that I wanted, fai...
[More]
by matt
17. March 2009 11:05
This was not the first time I've seen this error message in a web application. Usually it happens on the development box and a quick re-compile gets rid of it quite easily.
I had it today an a staging box, so re-compile is not an option. Looking at the fairly obviously generated file name, it's clear that this file is part of the ASP.Net compilation process, so that was the general area to look for a solution.
After a brief read about the Compilation Element in the web.config file on the MSDN library, I made a brief edit to my web.config so that the batch attribute is set to FALSE. This m...
[More]
by matt
30. January 2009 16:52
I was asked today how to go about downloading a file as a response to a server request. I think last time I had to do that was in that days of ASP.Classic.
Anyhow, incase you are interested, the following code will allow you to download content through the browser and should bring up the browser save dialogue.
// Load a lovely file (yep - I'm not too concerned about permissions here) and
// read it into a buffer
FileStream fs = new FileStream(@"C:\TestXMLFile.xml", FileMode.Open);
long fileSize = fs.Length;
byte[] fileBuffer = new byte[Convert.ToInt32(fileSize)];
fs.Read(fileBuffer, ...
[More]
by Stephen Horsfield
20. November 2008 17:10
I've just managed to get the .NET 3.5 style of WCF Web Programming Model services to work inside an EPiServer 5 R2 site on IIS 7 and Windows 2008. I had a few difficulties finding out how to integrate the new model into IIS/ASP.NET and then further problems getting it working in EPiServer. Here, I outline the solution.
Context
I'm currently designing a site that will be using the Akamai Edge Suite of technologies (www.akamai.com) and so I desire that all client access is through the caching layer. Additionally, I'm motivated towards a REST model for web services to support a greater degre...
[More]
by matt
19. September 2008 15:47
When trying to access remote content in Silverlight, you need to add a clientaccespolicy.xml file to the root of the web server that you are trying to access. I did this, my file looked like this: <?xml version="1.0" encoding="utf-8" ?>
<access-policy>
<cross-domain-access>
<policy>
<allow-from http-request-headers="*">
<domain uri="*"/>
</allow-from>
<grant-to>
<resource include-subpaths="true" path="/"/>
</grant-to>
<...
[More]
by matt
16. September 2008 12:00
I found myself with a little time between BizTalk Server tasks recently and decided it was high time I took a look at trying out Silverlight and seeing what it is worth. It's still early days for me at the moment, but I thought I would share my starting point.
I was lucky enough to find a series of posts buy Scott Guthrie that give a good 8-step tutorial on building a Silverlight application in Visual Studio 2008.
I've really only just started and am taking the time to read some surrounding content on the web about each step, but I have to say that it looks quite impressive so far (as I thi...
[More]
by Brad
12. June 2008 10:09
Having stumbled across Google's Webmaster Tools a while ago it's been in the back of my mind to create a custom HttpHandler to dynamically create a (virtual) SiteMap.xml file that Google (and other search engines) can use as a reference when spidering my sites. I thought I'd share the basic implantation as a starting point. Ideally you'd add a property to each EPiServer PageType page for "change frequency" and "priority" which the sitemap generator would then use, but for this basic version I've simply set the homepage to 1.0 (the maximum priority) with a daily change, and all other pages to ...
[More]
by Brad
9. June 2008 11:33
As part of my Search Engine friendly SiteMap.xml generator (using a HttpHandler - expect a blog post shortly...) I needed to output the friendly URL for each page in the site. However a call to PageData.LinkURL returns the actual link to the page (example shown below), not a "friendly" one that gets displayed in the browser address bar, or in any Hyperlink within the site. /MySite/Default.aspx?id=26&epslanguage=en-GB
I had a look through the EPiServer documentation and couldn't find anything obvious so resorted to creating my own method to do it (shown below). Simply pass the rele...
[More]
by Brad
9. June 2008 09:24
This post tells you how to take what I discussed in Part 1 and turn it into a custom EPiServer property, so CMS user's can simply enter a postcode and it will call of to Google's Local Search API, return the Coordinates for the postcode and plot a marker on the map. The user can then drag the marker for a more exact location, set the zoom level and finally the type of map (Normal, Satellite or Hybrid). The data is then rendered on the public site using the code from Part 1. The screenshot below show's how it will look in EPiServer (click the thumbnail for the full size version): Creating a...
[More]
by Brad
6. June 2008 15:17
Following on from my Google Analytics server control, I wanted make something "cooler", so creating a Server Control to render a Google Map control seemed ideal. Part 1 covers the creation of the this control, stay tuned for part 2 which will focus on creating a custom EPiServer property so it can be used in the EPiServer edit area, featuring Geocoding to lookup the coordinates from a UK post code, Map type selection and zoom level. Anyway here's the generic bit that can be used on any site... First off we need a set of basic properties to hold Latitude, Longitude, Zoom Level and Map Type: ...
[More]