Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > ASP .Net > ASP .Net Building Controls > Design Time Rendering Within Tables

Reply
Thread Tools

Design Time Rendering Within Tables

 
 
James F. Kubecki
Guest
Posts: n/a
 
      10-23-2003
Hello,
I'm attempting to build a composite control which for
purposes of layout renders its content as an HTML table
row (<tr>). At runtime, it works just fine, but at
design time, the control doesn't render at all.
The following is a simplified example which will
illustrate this:

(CONTROL CLASS)

public class RowTypeControl : Control
{
protected override void Render(HtmlTextWriter writer)
{
writer.Write("<tr><td>Foo</td><td>Bar</td></tr>");
}
}

(ASPX PAGE)

<table border=5>
<cc1:RowTypeControl id="RowTypeControl1"
runat="server"></cc1:RowTypeControl>
</table>

Again, at runtime, this renders perfectly, but at design
time, it doesn't show ANYTHING in the designer.

What am I missing?
JFK
 
Reply With Quote
 
 
 
 
Victor Garcia Aprea [MVP]
Guest
Posts: n/a
 
      10-23-2003
Hi James,

Based on your posted Render method, it should render ok. Could you post a
very small sample to repro this?

--
Victor Garcia Aprea
Microsoft MVP | ASP.NET
Looking for insights on ASP.NET? Read my blog:
http://obies.com/vga/blog.aspx
To contact me remove 'NOSPAM'. Please post all questions to the newsgroup
and not by private mail.

"James F. Kubecki" <(E-Mail Removed)> wrote in message
news:01e501c3999f$928e1260$(E-Mail Removed)...
> Hello,
> I'm attempting to build a composite control which for
> purposes of layout renders its content as an HTML table
> row (<tr>). At runtime, it works just fine, but at
> design time, the control doesn't render at all.
> The following is a simplified example which will
> illustrate this:
>
> (CONTROL CLASS)
>
> public class RowTypeControl : Control
> {
> protected override void Render(HtmlTextWriter writer)
> {
> writer.Write("<tr><td>Foo</td><td>Bar</td></tr>");
> }
> }
>
> (ASPX PAGE)
>
> <table border=5>
> <cc1:RowTypeControl id="RowTypeControl1"
> runat="server"></cc1:RowTypeControl>
> </table>
>
> Again, at runtime, this renders perfectly, but at design
> time, it doesn't show ANYTHING in the designer.
>
> What am I missing?
> JFK



 
Reply With Quote
 
 
 
 
James F. Kubecki
Guest
Posts: n/a
 
      10-23-2003
Hi,
Not sure what you need beyond the sample that was
originally posted. Can you elaborate?

JFK
>-----Original Message-----
>Hi James,
>
>Based on your posted Render method, it should render ok.

Could you post a
>very small sample to repro this?


 
Reply With Quote
 
Victor Garcia Aprea [MVP]
Guest
Posts: n/a
 
      10-23-2003
The RowTypeControl you just posted is *really* very simple and should work
okay. I'm guessing your real code its a bit different and it may contain
something that its causing the unexpected behavior. Could you describe what
exactly is being rendered on the design-surface? Nothing at all? Are you
able to select the control and move it around? Also if the control is not
apparently showing try selecting with the mouse a big region to see if
anything becomes selected.

--
Victor Garcia Aprea
Microsoft MVP | ASP.NET
Looking for insights on ASP.NET? Read my blog:
http://obies.com/vga/blog.aspx
To contact me remove 'NOSPAM'. Please post all questions to the newsgroup
and not by private mail.

"James F. Kubecki" <(E-Mail Removed)> wrote in message
news:03f101c399a5$e3653460$(E-Mail Removed)...
> Hi,
> Not sure what you need beyond the sample that was
> originally posted. Can you elaborate?
>
> JFK
> >-----Original Message-----
> >Hi James,
> >
> >Based on your posted Render method, it should render ok.

> Could you post a
> >very small sample to repro this?

>



 
Reply With Quote
 
James F. Kubecki
Guest
Posts: n/a
 
      10-23-2003
Oh OK. The RowTypeControl example shown below IS much
simpler than the "real code", HOWEVER it behaves exactly
the same way.
Specifically, on the design surface, NOTHING is
rendered. There is not even a handle for selecting the
control. If you select the control in the properties
window or in Document Outline, there is no change to the
rendered view to indicate that anything selected.

Also, if you add any other table rows, those rows are
rendered (so you can now see the table) but the control
remains unrendered.

Example:
<table border=5>
<tr>
<td>Foo</td>
<td>Bar</td>
</tr>
<cc1:RowTypeControl id="RowTypeControl1"
runat="server"></cc1:RowTypeControl>
<tr>
<td>Foo</td>
<td>Bar</td>
</tr>
</table>

Renders as:

+---+---+
|Foo|Bar|
+---+---+
|Foo|Bar|
+---+---+

The rendering above is simulated, of course...

JFK

>-----Original Message-----
>The RowTypeControl you just posted is *really* very

simple and should work
>okay. I'm guessing your real code its a bit different

and it may contain
>something that its causing the unexpected behavior.

Could you describe what
>exactly is being rendered on the design-surface? Nothing

at all? Are you
>able to select the control and move it around? Also if

the control is not
>apparently showing try selecting with the mouse a big

region to see if
>anything becomes selected.
>
>--
>Victor Garcia Aprea
>Microsoft MVP | ASP.NET
>Looking for insights on ASP.NET? Read my blog:
>http://obies.com/vga/blog.aspx
>To contact me remove 'NOSPAM'. Please post all questions

to the newsgroup
>and not by private mail.


 
Reply With Quote
 
Victor Garcia Aprea [MVP]
Guest
Posts: n/a
 
      10-23-2003
Please try creating a brand new test web app project (to isolate as much as
possible from your current project), include the code for the control you
posted and see how it works. If you still don't get any design-time support
then I'm guessing your VS.NET installation may have been corrupted or
something.

--
Victor Garcia Aprea
Microsoft MVP | ASP.NET
Looking for insights on ASP.NET? Read my blog:
http://obies.com/vga/blog.aspx
To contact me remove 'NOSPAM'. Please post all questions to the newsgroup
and not by private mail.

"James F. Kubecki" <(E-Mail Removed)> wrote in message
news:053701c399a8$add48f50$(E-Mail Removed)...
> Oh OK. The RowTypeControl example shown below IS much
> simpler than the "real code", HOWEVER it behaves exactly
> the same way.
> Specifically, on the design surface, NOTHING is
> rendered. There is not even a handle for selecting the
> control. If you select the control in the properties
> window or in Document Outline, there is no change to the
> rendered view to indicate that anything selected.
>
> Also, if you add any other table rows, those rows are
> rendered (so you can now see the table) but the control
> remains unrendered.
>
> Example:
> <table border=5>
> <tr>
> <td>Foo</td>
> <td>Bar</td>
> </tr>
> <cc1:RowTypeControl id="RowTypeControl1"
> runat="server"></cc1:RowTypeControl>
> <tr>
> <td>Foo</td>
> <td>Bar</td>
> </tr>
> </table>
>
> Renders as:
>
> +---+---+
> |Foo|Bar|
> +---+---+
> |Foo|Bar|
> +---+---+
>
> The rendering above is simulated, of course...
>
> JFK
>
> >-----Original Message-----
> >The RowTypeControl you just posted is *really* very

> simple and should work
> >okay. I'm guessing your real code its a bit different

> and it may contain
> >something that its causing the unexpected behavior.

> Could you describe what
> >exactly is being rendered on the design-surface? Nothing

> at all? Are you
> >able to select the control and move it around? Also if

> the control is not
> >apparently showing try selecting with the mouse a big

> region to see if
> >anything becomes selected.
> >
> >--
> >Victor Garcia Aprea
> >Microsoft MVP | ASP.NET
> >Looking for insights on ASP.NET? Read my blog:
> >http://obies.com/vga/blog.aspx
> >To contact me remove 'NOSPAM'. Please post all questions

> to the newsgroup
> >and not by private mail.

>



 
Reply With Quote
 
Andrew
Guest
Posts: n/a
 
      11-24-2003
From what I have learned, the chunk of html you generate in Render will be
separate from any html in the page.

The simplest illustration of this is touse two literal, one has .Text to
open a table, the other to close it.
This will work at runtime for the browser, but the designer surface will not
show them as a single table.

While I doubt it is what you want, you can check my meaning by putting the
html for the table into the custom control's render method (with the row and
cell tags).

To get around this, you could try working with the asp:table or building
annother table control of your own, that will render the table tags and your
custom row controls.

-Andrew Stevenson
UITemplates.net


"Victor Garcia Aprea [MVP]" <(E-Mail Removed)> wrote in message
news:(E-Mail Removed)...
> Please try creating a brand new test web app project (to isolate as much

as
> possible from your current project), include the code for the control you
> posted and see how it works. If you still don't get any design-time

support
> then I'm guessing your VS.NET installation may have been corrupted or
> something.
>
> --
> Victor Garcia Aprea
> Microsoft MVP | ASP.NET
> Looking for insights on ASP.NET? Read my blog:
> http://obies.com/vga/blog.aspx
> To contact me remove 'NOSPAM'. Please post all questions to the newsgroup
> and not by private mail.
>
> "James F. Kubecki" <(E-Mail Removed)> wrote in message
> news:053701c399a8$add48f50$(E-Mail Removed)...
> > Oh OK. The RowTypeControl example shown below IS much
> > simpler than the "real code", HOWEVER it behaves exactly
> > the same way.
> > Specifically, on the design surface, NOTHING is
> > rendered. There is not even a handle for selecting the
> > control. If you select the control in the properties
> > window or in Document Outline, there is no change to the
> > rendered view to indicate that anything selected.
> >
> > Also, if you add any other table rows, those rows are
> > rendered (so you can now see the table) but the control
> > remains unrendered.
> >
> > Example:
> > <table border=5>
> > <tr>
> > <td>Foo</td>
> > <td>Bar</td>
> > </tr>
> > <cc1:RowTypeControl id="RowTypeControl1"
> > runat="server"></cc1:RowTypeControl>
> > <tr>
> > <td>Foo</td>
> > <td>Bar</td>
> > </tr>
> > </table>
> >
> > Renders as:
> >
> > +---+---+
> > |Foo|Bar|
> > +---+---+
> > |Foo|Bar|
> > +---+---+
> >
> > The rendering above is simulated, of course...
> >
> > JFK
> >
> > >-----Original Message-----
> > >The RowTypeControl you just posted is *really* very

> > simple and should work
> > >okay. I'm guessing your real code its a bit different

> > and it may contain
> > >something that its causing the unexpected behavior.

> > Could you describe what
> > >exactly is being rendered on the design-surface? Nothing

> > at all? Are you
> > >able to select the control and move it around? Also if

> > the control is not
> > >apparently showing try selecting with the mouse a big

> > region to see if
> > >anything becomes selected.
> > >
> > >--
> > >Victor Garcia Aprea
> > >Microsoft MVP | ASP.NET
> > >Looking for insights on ASP.NET? Read my blog:
> > >http://obies.com/vga/blog.aspx
> > >To contact me remove 'NOSPAM'. Please post all questions

> > to the newsgroup
> > >and not by private mail.

> >

>
>



 
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
GetElementbyID question - within MasterPage/contentpage - within tables Elmo Watson ASP .Net 1 05-08-2007 05:12 PM
Tables within tables Otuatail HTML 7 08-02-2004 04:42 AM
Design time rendering of a composite custom web control Barry Carr ASP .Net 4 01-15-2004 09:03 PM
WebControl rendering an ActiveX ctrl - design time problem Gergely Varadi ASP .Net Building Controls 0 07-25-2003 12:18 AM
design-time rendering doesn't happen unless properties changed Oleg Ogurok ASP .Net Building Controls 0 07-11-2003 04:55 PM



Advertisments