Posts

Moving A DotNetNuke Install Into Root ( Up A Directory )

Finally managed to get my DNN v4.6.2 install into the root. My problem was I had tried darrenmcleod.com/ as the portal alias but it kept giving me an infinite redirect error.  Then I tried darrenmcleod.com as the portal alias and everything is goodness.  Note that when you make a change like this just through the database you need to do something to cause your application to reload, like editing a line in web.config and saving it.

Dynamic HeaderText for an ASP.NET 2.0 Wizard Control

I wanted to have the Wizard Control Header display the current step’s title, after a little research I found that the ActiveStepChanged event would allow me to do this. So I added an event handler like this: Protected Sub Wizard1_ActiveStepChanged( ByVal sender As Object , ByVal e As System.EventArgs) Handles Wizard1.ActiveStepChanged Me .Wizard1.HeaderText = Me .Wizard1.ActiveStep.Title End Sub Except it didn’t set the Header for the first step so I set the HeaderText manually to the first step’s title like this: < asp:Wizard ID =" Wizard1 " runat =" server " HeaderText =" Step 1 " > < WizardSteps > < asp:WizardStep ID =" WizardStep1 " runat =" server " Title =" Step 1 " > < / asp:WizardStep > < asp:WizardStep ID =" WizardStep2 " runat =" server " Title =" Step 2 " > ...

How to make an ASP.NET Web User Control Width editable.

Add a property to your WebUserControl: Private widthValue As Integer Public Property Width() As Integer Get Return widthValue End Get Set ( ByVal value As Integer ) widthValue = value End Set End Property Then add a prerender event handler to the WebUserControl, where in this example the MainTable happens to be the outermost container element in the Web User Control with a width attribute: Private Sub Page_PreRender( ByVal sender As Object , ByVal e As System.EventArgs) Handles Me .PreRender If Me .Width > 0 Then Me .MainTable.Width = Me .Width End If End Sub Then wherever you use the control you can specify the width if you want to: < uc2:MyWebUserControl ID =" MyWebUserControl1 " runat =" server " width =" 650 " / >

VS 2005 Team System Webtest ValidationRule on an asp:dropdownlist control

With this html: <select name="ctl00$ContentPlaceHolder1$CompanyDropDownList" id="ctl00_ContentPlaceHolder1_CompanyDropDownList" class="Normal">   <option selected="selected" value="1">All</option>   <option value="2">Company 1</option>   <option value="3">Company 2</option>   <option value="4">Company 3</option>   <option value="5">Company 4</option>   <option value="6">Company 5</option>  </select> In my webtest I wanted to verify CompanyDropDownList had selected option 2 "Company 1". Tried Form Field with form field name ctl00$ContentPlaceHolder1$CompanyDropDownList but it did not work. Using Required Attribute Value worked with the following values: Attribute Name             value Expected Value        ...

Microsoft.ApplicationBlocks. ExceptionManagement The event source x does not exist error

 If you get the following error when using the Microsoft.ApplicationBlocks.ExceptionManagement library: System.Security.SecurityException: The event source ExceptionManagerInternalException does not exist and cannot be created with the current permissions. ---> System.Security.SecurityException: Requested registry access is not allowed. at System.ThrowHelper.ThrowSecurityException(ExceptionResource resource) at Microsoft.Win32.RegistryKey.OpenSubKey(String name, Boolean writable) at System.Diagnostics.EventLog.CreateEventSource(EventSourceCreationData sourceData) at System.Diagnostics.EventLog.CreateEventSource(String source, String logName) at Microsoft.ApplicationBlocks.ExceptionManagement.DefaultPublisher. VerifyValidSource() One way of solving this is to install the Microsoft.ApplicationBlocks.ExceptionManagement.dll by running the following in a dos window: C:\WINDOWS\Microsoft.NET\Framework\v2.0.50727\InstallUtil.exe Microsoft.ApplicationBlocks.Excep...

Avoid DTC call in Entity Framework 4 on SQL Server 2005

Ok really went down a rabbit hole today but I managed to crawl back out.  I went to create a database connection test. It consisted of first creating a transaction and then select a count of the number of records that match the record I was about to add, add the record, then count again to make sure the count is now different from the first count. This triggered a distributed transaction coordinator(DTC) error because I didn't have distributed transactions turned on but I didn't want it to start a distributed transaction as they add processing time and are not needed in this scenario.  So after much research I've discovered this apparently wouldn't have occurred if I was using SQL Server 2008 or greater but I of course was connecting to 2005. In Entity Framework 6(EF6) it looks like they are finally giving us the option to tell the Entity Framework to use an existing transaction and not force a distributed one. Which will be nice when EF6 is released and I upgrade ...

NArrange - organize your code effortlessly

Image
The second thing I do( this is the first ) with a new install of Visual Studio is I head over to  http://www.narrange.net/download.aspx  and download the latest version of NArrange.  NArrange is an open source .NET code organizer/formatter/beautifier. After downloading and installing(and noting the folder where the exe is installed) the NArrange setup.msi, I go into my new install of Visual Studio and click on Tools and select External Tools . This opens the External Tools dialogue.  Click Add  and in the Title  field I put "NArrange" and beside the Command  field I click the ... (browse) button and go to the folder where I installed NArrange and select the narrange-console.exe file.  For Arguments  I like to only do one file at a time as I'm working so I set it to $(ItemFileName)$(ItemExt) /b and the Initial directory  to $(ItemDir).  The /b causes a back up of the file before NArrange makes it's changes, thi...