brian.chandley
2/1/2007 1:31:00 AM
The desired affect is to take a portion of a search input form has a
lot of Javascript and make it a standard part of many search pages.
It presents the user with a series of options and validates selection,
and limits selection based on who you are. This is not code I want to
be copied and pasted. This control will be used across several web
projects, so a UserControl is out of the question.
An implementation would look like this:
<table >
<tr>
<td>Site</td>
<td><input ... > </td>
</tr>
<tr>
<td>CIty</td>
<td><input ... > </td>
</tr>
<CC1:TerritorySearch id="TerritorySearch2" runat="server"></
CC1:TerritorySearch>
</table>
When The User executes his/her search, the code behind would read the
Search type and Search value properties.
Per Tom's suggestion, I used the debugger and my designer is being
called, I wounder if it assumes that it is just a TR, which has no
visible elements.
For a moment, I thought I could inherit from the TableRowCollection,
until I saw it is marked as sealed. I also hoped I could reach out to
the parent and add the rows I created to it's TableRowCollection but
this.Parent Is not a table, but the form.
On Jan 31, 3:19 pm, "Peter Zolja" <x...@x.com> wrote:
> > I have also tried, with no luck.
>
> > <TBody>
> > <tr>
> > <td colspan=2>heading</td>
> > </tr>.
> > <tr>
> > <td>Label</td>
> > <td>Input</td>
> > </tr>
> > <tr>
> > <td>anothe Label</td>
> > <td>another Input</td>
> > </tr>.
> > </TBody>
>
> If you override WebControl you automatically get a <div> around your
> control; if your base class is Control you don't have this issue. In any
> case, I tried to do a simple test application and I got the same behavior.
> Putting the custom control within <table></table> would make it invisible in
> the designer. Mind you, it is doing this with the built-in controls as well,
> which leads me to believe it's a VS designer limitation.
>
> Is there any reason why your control can not output the <table> tag as well
> (in which case you'll be able to see the control in the designer)? If you'd
> give us more information about what you're trying to achieve we may be able
> to suggest a different approach.