PDA

View Full Version : Inherit Coolite ScriptManager



kowi
Nov 05, 2009, 5:15 PM
Hi,

Im trying to inherit the coolite scriptmanager so I can make a custom server control.

Pretty simple to start with:


using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Linq;
using System.Text;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using Coolite.Ext.Web;

namespace MyWebApp.Controls
{

public class MyWebAppScriptManager : Coolite.Ext.Web.ScriptManager
{

}
}


Im getting a bug.

So, I build my new control and add the assembly to the visual studio toolbox in a website.

When I drag the custom control to the design view of the page the visual studio window freezes and the cursor goes "crazy".

Any help on this.

Ty

kowi
Nov 12, 2009, 6:47 PM
Any help at all?

Im trying this to fix it but still get the same bug:



protected override void Render(HtmlTextWriter writer)
{
writer.Write("<div style='border-width: thin; border-style: ridge; width:100%; height: 100%; background-color: #CCCCCC; text-align: center; font-weight: bold; color: #666666;' align='center' >" + "[" + this.ID + "]" + "
");
base.Render(writer);
}

internal void RenderAction(HtmlTextWriter writer)
{
if (this.DesignMode)
{
writer.Write("<div style='border-width: thin; border-style: ridge; width:100%; height: 100%; background-color: #CCCCCC; text-align: center; font-weight: bold; color: #666666;' align='center' >" + "[" + this.ID + "]" + "
");
return;
}
}

geoffrey.mcgill
Nov 12, 2009, 6:54 PM
Hi kowi,

I tried to reproduce what you describe, but based on the code and description posted above, I did not experience "visual studio window freezes and the cursor goes "crazy".


At this point my best solution would be to avoid using Visual Studio Design Mode. It's very buggy. Configuring in Source Mode should give more consistent results.


Hope this helps.

geoffrey.mcgill
Nov 12, 2009, 6:56 PM
Can you provide more information regarding the purpose of your Render and RenderAction overrides?

Maybe you could post a sample Visual Studio Solution (.sln) demonstrating how you have everything configured. Please do not include the .dll's.