Xerratus
Happily stressed out, since 1974


 
Sunday, December 02, 2007

Yesterday, my wife and I went out to our favorite christmas tree farm and picked out three lovely trees.  Yes, I said three.  We do this. 



The farmer was nice enough to let my wife cut down the smallest of them.



Exhilarating! Her first confirmed kill.



After all that hard work, here she is in her "pose" under a warm cup of Peet's Coffee.

Tuesday, October 30, 2007

I recently installed Google Deskbar and the image rotator went and indexed my pictures directory (Vista's toolbar did not).  Today, while working, I looked up and smiled because I saw my wife looking at me. 



Isn't she adorable?
Tuesday, September 04, 2007



My wife got the Monroe.
Monday, August 20, 2007

So, for the past couple of weeks, while working on a project that involves integration with Community Server 2007 I've run into the annoying and ambiguous message "Unable to start debugging on the web server".



Now, I've set up IIS sites before and I know to check the usual suspects; app pool, Windows authentication, etc.  But with the tight deadline of this project, I just haven't had the time to research this one.  Googling this usually just brings up forums where "Unable to start debugging on the web server" is brought up that are run on Community Server.  Yeah, helpful.

So, today I need (stress the word NEED) to debug this application because the blog web service is not returning consistent data.  That's a whole other WTF, but for now we'll stick with the issue at hand; getting the damn thing to debug.

With that, I have to figure this out.  Within a few minutes I find myself in this forum which is telling me that it's my IIS is corrupt and that I have to uninstall everything .NET then reinstall it all.  Bullshit I say!  BULLSHIT!  So I continue to scroll down when I see a reply from a "David B" which simply says to change the debug attribute in the web.config to true.  YES!  Community Server distributes the SDK with this option set to false.  Damn, I need to remember this!

So, for those of you in the same boat, DO NOT reinstall IIS and everything .NET, just change the web.config to the following:

<compilation debug="true" defaultLanguage="c#">

Works like a charm.
Wednesday, August 15, 2007

Working on a project today that has some aspects that integrate with Community Server, I ran into a slight problem.  I needed to replace the submit resource link button for adding comments with an image button.  At first it sounded easy.  Just replace the <CSControl:ResourceLinkButton /> with an <asp:ImageButton />.  Not so fast, the compiler said.  The <CSBlog:WeblogPostCommentForm /> was looking for a link button that inherits from CSLinkButton.  Of course, the built in image button does not do that.  So my solution, create my own custom composite control that inherits CSLinkButton but generates a link button.

Here's how I did it:

First, create a new control in the CommunityServerControls20 project (anywhere is fine but I put it in a new folder called "Custom") and call it CustomImageLinkButton.cs.

Add the following code:

using System;
using System.ComponentModel;
using CommunityServer.Components;

namespace CommunityServer.Controls
{
    
public class CustomImageLinkButton : CSLinkButton
    {
        [
Bindable(true)]
        
public virtual string ImageUrl
        {
            
get
            {
                
object state = ViewState["ImageUrl"];
                
if(state != null)
                {
                    
return (string)state;
                }
                
return "";
            }
            
set { ViewState["ImageUrl"] = value; }
        }

        
protected override void OnPreRender(EventArgs e)
        {
            
base.OnPreRender(e);

            
if(!Globals.IsNullorEmpty(ImageUrl))
            {
                System.Web.UI.WebControls.
Image image = new Image();
                image.ImageUrl = ImageUrl;
                
this.Controls.Add(image);
            }
        }
    }
}

When you create the control in the UI and pass in an ImageUrl, the control creates an image object and adds it to the links control array.  That's it.

Here is the UI code in action:

<CSBlog:WeblogPostCommentForm ID="WeblogPostCommentForm1" runat="server">
    ... snip ...
    <FormTemplate>
         <div class="CommonFormArea">
             ... snip ...
            
<div class="CommonFormField">
                <br />
                <CSControl:CustomImageLinkButton runat="server" ID="btnSubmit" ImageUrl="http://localhost/project1/images/submit.jpg" ValidationGroup="CreateCommentForm" />
             </div>
        </div>
    </FormTemplate>
</
CSBlog:WeblogPostCommentForm>

Enjoy!