DropDownList.SelectedValue only throws exceptions on page postbacks?

by Dominic Zukiewicz 28. February 2008 15:56
Load a, ASP .NET DropDownList with values. Assign the .SelectedValue to an item that doesn't exist, and the DropDownList will happily continue, defaulting to the first entry in the drop-down. Now, on the postback, try to select this value AGAIN, and you get an exception!? Why ... well, thats just the way the component is coded!! So therefore, the first assignment will work ALWAYS (as long as it is the first page load), and otherwise it will throw an ArgumentOutOfRangeException. I am as of yet unsure why it was created this way, but the only way round it, is to check it exists for yoursel... [More]

Tags:

SQL Reporting Services Access Denied Error

by Dan Matthews 28. February 2008 11:47
When trying to access your Report Manager, you might see an Access Denied error with an entry in your application log like: Failed to execute request because the App-Domain could not be created. Error: 0x80070005 Access is denied. Thankfully it's a simple one to fix. It's caused because ASP.NET cannot access the Reporting Services folders. I'm not sure what the minimum access permissions are but this was on dev so I simply gave the Network Service full control on my 'ReportManager' and 'ReportServer' folders and that sorted things.

Tags:

EPiServer plugin in a single assembly

by Dan Matthews 28. February 2008 09:41
I was writing an EPiServer plugin recently and it was bothering me slightly that EPiServer only supports .ASCX or .ASPX pages for plugins. What I wanted to do was just drop a single DLL file into the BIN folder of my website. EPiServer 5 does have much better plugin management, true, but it still bothered me. I wanted to have control over the content of my plugin and didn't want to have to package my control along with a DLL. After rummaging around a bit to see if EPiServer would pick up any overridden render methods if I missed the URL attribute off a plugin (it doesn't) I decided to drop St... [More]

Tags:

EPiServer | .NET/C#

EPiServer plugin in a single assembly - NOT PUBLISHED

by Dan Matthews 27. February 2008 15:48
I was writing an EPiServer plugin recently and it was bothering me slightly that EPiServer only supports .ASCX or .ASPX pages for plugins. What I wanted to do was just drop a single DLL file into the BIN folder of my website. EPiServer 5 does have much better plugin management, true, but it still bothered me. I wanted to have control over the content of my plugin and didn't want to have to package my control along with a DLL. After rummaging around a bit to see if EPiServer would pick up any overridden render methods if I missed the URL attribute off a plugin (it doesn't) I decided to drop St... [More]

Tags:

.NET/C# | EPiServer

Creating C# Class from an XML file

by Brad 25. February 2008 09:16
If you've existing XML files that you need to manipulate in C# there is no need to write your own class by hand. Visual Studio ships with a little known tool XSD.exe which will do all the leg work for you. Step 1 (from a command prompt): This will create an XSD based on the XML file, which in step 2 will allow the tool to create the C# class(s) XSD.exe [XML_FILE] Step 2 (from a command prompt): Call the tool again, this time providing the newly created .xsd file, along with /c (for classes, you could use /d for a dataset) and /n for your project's namespace XSD.exe [XSD_F... [More]

Tags:

C# | Microsoft Visual Studio

EPiServer Manager gotchas

by Dan Matthews 22. February 2008 10:44
Just a couple of quick gotchas when using EPiServer manager: EPiServer Manager 1.2x to 1.3.3.0 upgrade: When you try to install the new version you get an option to repair or remove. You actually need to remove and then run the install again. Repair doesn't actually upgrade it. EPiServer manager 2.0.19.4 install of site: For some reason when you try to install into your inetpub folder it insists on using c:\inetpub\MyEPiServer, as below: If you want to use MyEPiServer that's fine, but if you don't then it's greyed out which is a bit unhelpful. Thankfully it's just a bug which can be got a... [More]

Tags:

EPiServer

Catering for NULL values when reading XML

by Dominic Zukiewicz 21. February 2008 12:57
Today, I had a quick look at the problems associated with missing tags in XML. If you are expecting a numeric value and the tag is missing, you'll get (in the case of int), a default to 0. This, of course happens as the assignment never takes place, and when displaying the data, is just reading the compiler assigned default of 0. Now, lets take this a step further, and say you want to cater for it when it is missing, i.e. NULL - how do you do that? The wonderful XmlSerializer will assign a XXXSpecified property with a boolean, when the tag is present. You must have declared this prope... [More]

Tags:

Xml

BizTalk: Send Port Filters Get Ignored

by matt 20. February 2008 09:32
This is kind of a not to anyone who does not understand why their send port filters might be being ignored.  It is not the be-all and end-all of the problem as there may be various reasons for the problem occurring. If you are attempting to use filtering on Send Ports that belong to a Send Port Group, then forget it.  BizTalk Server assumes that if the Send Port Group receives the message, then all Send Ports in that group must want the message regardless of any filters that you may have set up.  It basically ignores the filtering in the port completely.  This would not be so much of a pr... [More]

Tags:

BizTalk Server

Writing your own AD/ADAM permissions editor - Part 3

by Dan Matthews 20. February 2008 08:48
In my last post we discussed the DACL and how to get the Access List from a Directory Entry object. We finished the post by grabbing our (D)ACL as an AuthorizationRuleCollection. In this post we are going to look at what that collection contains; a set of AuthorizationRule objects. Just to make things a little more interesting, the AuthorizationRuleCollection can contain two types of rule - Access Rules (for the DACL) and Audit Rules (for the SACL). As we are looking at the DACL rather than the SACL we will be looking at a type that is inherited from the AuthorizationRule called an AccessRule... [More]

Tags:

.NET/C# | ADXSTUDIO

Firebrand / Training Camp

by Dan Matthews 18. February 2008 16:43
  Well I'm back from my holidays to South Africa, and trying my best to adjust to a British winter after enjoying Summer on the Indian Ocean :) As a company we've been using the Training Camp for quite a while (MOSS, .NET exams, CRM) and it recently rebranded itself as Firebrand. Well worth a look if you have any training requirements, especially if you need a real kickstart to a technology for an urgent need. And no matter how well you plan, you just know that your next project will be that new version of the server technology that you didn't expect to come just yet!

Tags:

Conflict with App_Code.xxxx.dll and website DLLs on WAP projects

by Dominic Zukiewicz 18. February 2008 12:23
Recently, we upgraded a project to a WAP project, but then we started getting errors about conflicts. Here is an error we had: Parser Error Message: The type 'CSSFriendly.MenuAdapter' is ambiguous: it could come from assembly 'C:\WINDOWS\Microsoft.NET\Framework\v2.0.50727\Temporary ASP.NET Files\myproj\1f01e60c\21e000e7\App_Code.9qbk2vh7.DLL' or from assembly 'D:\WebSites\MyNewWebSiteProject\myproj\bin\myproj.DLL'. Please specify the assembly explicitly in the type name. The parts that were conflicting were the App_Code.xxxxx.dll and the website DLL. But why??? The reason is that t... [More]

Tags:

Using delegates to simulate WaitHandle.WaitAll() calls for web service - Part 1

by Dominic Zukiewicz 7. February 2008 14:14
This article is part 1 of 2 articles. Wouldn't it be great if you could call a web service hundreds, if not thousands of times, and then just wait until the results come back, rather than doing it one at a time? The System.Threading namespace created WaitHandle.WaitAll(), but this is only useful for threads - how do you call lots of web services asynchronously, and then continue once they have all returned? Well, one could argue why don't you just call them synchronously? Good idea, but it just means that those extra seconds of time taken waiting, could be put to use by another web se... [More]

Tags:

Framework | Misc

ASP.NET: Accessing User Profiles in external Class Library (Dll)

by Brad 4. February 2008 16:11
Following on from my last post I've since discovered how to access the User's Profile in an external Class Library (like I've mentioned before I prefer to factor out all business logic code into a separate class library). Anyway the code is almost the same, although unfortunately you don't get strongly typed properties out of the box (unless you create your own profile object, inheriting from System.Web.Profile.ProfileBase). Here's how to access the current user's properties (using FirstName/LastName) as before, only this time in a separate dll... string firstname = HttpContext.Current.P... [More]

Tags:

ASP.NET: Accessing other User's Profiles

by Brad 4. February 2008 15:56
One of the many improvements in ASP.NET 2.0 was the Provider based architecture, and the most under used (certainly by me) is the User Profile Provider (click here for more info). You simply define the properties you want your users to have in the web.config (see below) <profile enabled="true" defaultProvider="MyProvider"> <providers> <add name="MyProvider" connectionStringName="MyConnection" applicationName="/" type="System.Web.Profile.SqlProfileProvider" /> </providers> <properties> <add name="F... [More]

Tags:

C#

Add extra Remote Desktop (RDP) / Terminal Services port

by Brad 4. February 2008 09:40
If like me you've more than one computer at home and would like to be able to RDP to them directly then read on! If you follow the steps below you will be able to add extra "listening" ports to each of your computers so you can access them from anywhere... The reason you need to do this is to allow you to specify specific port forwarding rules in your firewall/router. The default RDP port is 3389 so I leave my main computer alone, but if i want to access my media centre I can get to it by adding :3390 to my hostname/ip. Any other computers you can just increase the port number. Step one: Run... [More]

Tags:

Microsoft Server 2003

DataSet.Merge() didn't merge tables correctly.

by Dominic Zukiewicz 1. February 2008 09:54
I was using DataSet.Merge() to merge rows returned by a SqlDataAdapter into one of the tables. The scenario was that I was enquiring a specific order/product in the database, and it would Fill() a temporary DataSet with the results. If there were no results, then I just continued. The code was something like: internal AuditableProduct[] GetAuditableProducts(int[] productIds){ DataSet allStatuses = new DataSet(); foreach(int product in productIds) { DataSet tempStatus = new DataSet(); SqlConn... SqlComm..... SqlDataAdapter da...... ... [More]

Tags:

Framework

Powered by BlogEngine.NET 1.5.0.7
Theme by Interakting

Interakting

A full service digital agency offering online strategy, design and usability, systems integration and online marketing services that deliver real business benefits and ensure your online objectives are met.

Calendar

<<  March 2010  >>
MoTuWeThFrSaSu
22232425262728
1234567
891011121314
15161718192021
22232425262728
2930311234

View posts in large calendar