Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > ASP .Net > Web Custom Control - Tooltip and Rendering within IDE

Reply
Thread Tools

Web Custom Control - Tooltip and Rendering within IDE

 
 
Steve R
Guest
Posts: n/a
 
      10-30-2003
I've built a composite web custom control with a lot of
child controls. I assigned ToolTip values to some of
these controls. The ToolTip pop-ups were working fine
until I monkeyed with the order I am rendering the
controls. I had to do this so that the control rendered
properly when a developer drags it from the toolbox onto
the page. Any ideas?

Below is the meat of the code from my user control. The
remainder is private methods.
************************************************** **

using System;
using System.Data;
using System.Data.SqlClient;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Web.UI.HtmlControls;
using System.ComponentModel;
using Microsoft.Web.UI.WebControls;
using Common.Controls;

namespace smc.Vehicles
{
/// <summary>
/// Summary description for VehicleSearch.
/// </summary>
[DefaultProperty("Text"),
ToolboxData("<{0}:VehicleSearch
runat=server></{0}:VehicleSearch>")]
public class VehicleSearch :
System.Web.UI.WebControls.WebControl, INamingContainer
{
SqlConnection _connection;
VehicleSearch.TypeOfSearch typeSearch =
VehicleSearch.TypeOfSearch.PICK;

// child controls
Panel theDiv = new Panel();
Panel thePanel = new Panel();
Image theLogoImage = new Image();

DropDownList ddlbProduct = new
DropDownList();
TextBox tbBodyStart = new TextBox();
TextBox tbBodyEnd = new TextBox();

DropDownList ddlbSeqType = new
DropDownList();
TextBox tbSeqStart = new TextBox();
TextBox tbSeqEnd = new TextBox();

TextBox tbEIM1 = new TextBox();
TextBox tbEIM2 = new TextBox();
TextBox tbEIM3 = new TextBox();
TextBox tbEIM4 = new TextBox();
TextBox tbEIM5 = new TextBox();
TextBox tbEIM6 = new TextBox();
TextBox tbEIM7 = new TextBox();
TextBox tbEIM8 = new TextBox();
TextBox tbEIM9 = new TextBox();
TextBox tbEIM10 = new TextBox();
TextBox tbEIM11 = new TextBox();
TextBox tbEIM12 = new TextBox();
TextBox tbEIM13 = new TextBox();
TextBox tbEIM14 = new TextBox();
TextBox tbEIM15 = new TextBox();
TextBox tbEIM16 = new TextBox();
TextBox tbEIM17 = new TextBox();
TextBox tbEIM18 = new TextBox();

DropDownList ddlbProduct2 = new
DropDownList();

TextBox tbSSDFrom = new TextBox();
TextBox tbSSDTo = new TextBox();
Common.Controls.nnaDateControl dcFrom =
new Common.Controls.nnaDateControl();
Common.Controls.nnaDateControl dcTo = new
Common.Controls.nnaDateControl();

[Bindable(false),
Category("Data"),
DefaultValue("")]
public SqlConnection Connection
{
get
{
return _connection;
}

set
{
_connection = value;
}
}

[Bindable(false),
Category("Appearance"),
DefaultValue("")]
public VehicleSearch.TypeOfSearch
SearchType
{
get
{
return typeSearch;
}

set
{
typeSearch = value;
}
}

public enum TypeOfSearch
{
PICK,
BUILDSEQUENCE,
STATUS,
COLOR
}

/// <summary>
/// Render this control to the output
parameter specified.
/// </summary>
/// <param name="output"> The HTML writer
to write out to </param>
protected override void Render
(HtmlTextWriter output)
{
this.RenderChildren(output);
}

protected override void OnInit
(System.EventArgs e)
{
InitializeControls();
base.OnInit(e);
}

protected override void OnLoad(EventArgs
e)
{
base.OnLoad(e);
registerClientFunctions();
}

public override void DataBind()
{
this.EnsureChildControls();

if (typeSearch !=
VehicleSearch.TypeOfSearch.PICK)
{
thePanel.Visible = false;
theLogoImage.ToolTip
= "The VEHICLE SEARCH control is in " +typeSearch.ToString
()+ " mode." +typeSearchDescription();
}
else
{
thePanel.Visible = true;
theLogoImage.ToolTip
= "The VEHICLE SEARCH control is in PICK mode. You can
choose the desired output type by changing the selection
in the SEARCH TYPE radio buttons.";
}

if (_connection.State !=
ConnectionState.Open)
{
_connection.Open();
}

fillProduct();
fillSequenceNumberType();

_connection.Close();
}
 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
How could I add a tooltip to an iframe ? Also, the tooltip contents has to be determine @ run-time ! Radu ASP .Net 1 01-08-2007 04:11 PM
Error rendering Custom Web Control in VS.NET ide pabloazorin@gmail.com ASP .Net 0 10-12-2006 07:45 PM
"Error Creating Control" when creating a custom control (Design Time). Can't see tooltip message. Ravi Ambros Wallau ASP .Net Web Controls 0 06-01-2005 02:36 PM
"Error Creating Control" when creating a custom control (Design Time). Can't see tooltip message. Ravi Ambros Wallau ASP .Net 0 06-01-2005 02:36 PM
ControlDesigner not invoked on custom control when control is rendered within another custom control Matt Sokol ASP .Net Building Controls 2 08-07-2003 07:13 AM



Advertisments