473,288 Members | 1,693 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,288 software developers and data experts.

Custom web control problems in the designer pane (simple examples)

I have a custom control that builds what we refer to as "Formlets"
around some content in a page. These are basically content "wrapper"
sections that are tables that have a colored header and provide an
open TD with a DIV in it for the content of this formlet. (The DIV is
for DHTML to hide and show the content)

I've created a web page showing step by step the two problems I'm
encountering. This problem is much easier to see than it is to
explain.

This page is best viewed with at least a 1280x1024 resolution.
http://www.cox-internet.com/wizndaly/gg/designer.htm
Here's a summary of my two problems:

1) If I change any properties using the Properties window in the
design pane, any child controls that I had nested in my custom web
control are gone once I switch back to HTML view.

2) If I have anything other than simple text nested in my custom web
control, the designer will not render it, but it will render
everything just fine when the page runs.

The html page above will show each of these problems in more detail.
By the way, I'm running Visual Studio 2003 on Windows XP with IE 6.0.

Any help is greatly appreciated!

Thanks!
Nov 17 '05 #1
19 2933
Hi,

I have followed your steps and reproduce the same symptoms. However, as my
opinion, it is not an issue of vs.net, instead, I think it is raised by
misuse of the custom control.

According to the code you provided, you authored a custom control that
exports some properties and methods. From consumer side of the custom
control, instead of putting any string between the open and close tag of
the control, we should access the public properties of the custom control
inside the open tag as follows:

<cc2:panelProblem id="PanelProblem1" style="Z-INDEX: 105; LEFT: 216px;
POSITION: absolute; TOP: 168px" runat="server" MyText="this is a formlet">

here, the custom control defined a property called MyText. To access the
property, we should use the syntax shown above.

The symptom we are discussing here occurs is because that IDE detects that
there is a misuse of the custom control and then the IDE removes it out.

If I have misunderstood your concern, please feel free to let me know.

Best regards,

Jacob Yang
Microsoft Online Partner Support
Get Secure! ¨C www.microsoft.com/security
This posting is provided "as is" with no warranties and confers no rights.

Nov 17 '05 #2
Jacob,

I guess after all that work I fell short on explaining the main purpose
of this custom control. Here is some pseudo-HTML of what a "production"
implementation of the formlet control would look like:

<formletCtl id="Formlet1" Title="Account Entry">
<table>
<tr>
<td>Account Number</td>
<td><asp:textbox.../></td>
</tr>
<tr>
...etc.
</tr>
</table>
</formletCtl>

- hardly something that could be solved with a "Text" property.

Given that, since you have recreated the problem, what do you think of
the Design view destroying my/our "Contents" when properties are toggled
in the Properties window? And what of problem 2? Any thoughts or
remedies?

Thanks,

Jason

*** Sent via Developersdex http://www.developersdex.com ***
Don't just participate in USENET...get rewarded for it!
Nov 17 '05 #3
Jacob,

I guess after all that work I fell short on explaining the main
purpose of this custom control. Here is some pseudo-HTML of what a
"production" implementation of the formlet control would look like:

<formletCtl id="Formlet1" Title="Account Entry">
<table>
<tr>
<td>Account Number</td>
<td><asp:textbox.../></td>
</tr>
<tr>
...etc.
</tr>
</table>
</formletCtl>

- hardly something that could be solved with a "Text" property.

Given that, since you have recreated the problem, what do you think of
the Design view destroying my/our "Contents" when properties are
toggled in the Properties window? And what of problem 2? Any
thoughts or remedies?

Thanks,

Jason
Nov 17 '05 #4
Hi Dales,

I am sorry if there is any misunderstanding.

To my knowledge, since the formlet is a custom control, we should place any
output of child controls inside the Render method of the custom control,
rather than inserting any contents between the open and close tags on the
consumer side. That is, we should move the html table above into the custom
control. What do you think about it?

Best regards,

Jacob Yang
Microsoft Online Partner Support
Get Secure! ¨C www.microsoft.com/security
This posting is provided "as is" with no warranties and confers no rights.

Nov 17 '05 #5
> To my knowledge, since the formlet is a custom control, we should place any
output of child controls inside the Render method of the custom control,
rather than inserting any contents between the open and close tags on the
consumer side. That is, we should move the html table above into the custom
control. What do you think about it?


Jacob,

With all due respect, I think you're still missing the point. This
formlet control is not a composite control but what I'm referring to
as a "wrapper control".

Please read the following carefully and in it's entirety (I "DO"
appreciate you trying to help, by the way)...

The formlet is basically a fancy table within a table that will "WRAP"
whatever HTML you enclose within it's tags (see screenshots at
http://www.cox-internet.com/wizndaly/gg/designer.htm).

Our current non-.NET formlet is a VBScript class. In your ASP page,
you instantiate the formlet, set a few properties, call the
..StartFormlet() method, code your complex HTML, call the .EndFormlet()
method, and destroy the object. This is a shared component that is
used all over our intranet for a common look and feel, and the .NET
version should then be a custom web control in the GAC for our
enterprise-wide usage. I'm jumping ahead a little here...

EVERY formlet (and by "every" I mean thousands upon thousands on our
intranet) will have it's own (DIFFERENT) content. It is meant to be a
wrapper table.

In my opinion, we are trying to use our formlet custom control just as
it was intended - it's no different than a "panel" or a "label" or any
other "wrapper controls" but it renders some additional HTML for it's
opening and closing tags.

What the programmer "encloses" in their formlet is insignificant. It
should be able to simply handle this with RenderContent().

In a perfect world, this should allow the developer to drag and drop a
number of formlet controls onto the page in Design view, go to HTML
view and populate the contents, switch back to design view, see how it
will look, toggle some properties, etc. and NEVER lose the HTML they
just spent time coding.

Even with an arguably immature IDE such as VS .NET 2003, they should
still never lose the HTML they just spent time coding.

In my opinion, this is a serious bug in VS .NET, and a big hinderance
to our development of reusable components in an enterprise
environment, unless someone can tell me what I'm doing wrong in my use
of RenderContent(). For others viewing this thread, please see:

http://www.cox-internet.com/wizndaly/gg/designer.htm

Another way to look at this is as such...

I'm basically trying to create a custom control that will be a fancy
panel. A panel control will allow you nest as much HTML within it's
tags as your heart desires. If you start changing the properties of
the Panel control, you don't lose the "innerHTML" (forgive the client
side references) you just coded.

At some point in time, a Microsoft developer wrote the "panel" control
by inheriting "System.Web.UI.WebControls.WebControl" and coded the
following PSEUDOCODE in the Render subroutine:

output.write("<DIV>") 'or output.WriteBeginTag("DIV")
RenderContents() 'or is it MyBase.RenderContents()?
output.write("</DIV>") 'or output.WriteEndTag("DIV")

Here's my pseudocode formlet version:

output.write("<table class='...' cellpadding=...><tr><td><table
class='...'><tr><td>")
RenderContents()
output.write("</td></tr></table></td></tr></table>")

This is not at all the code for the formlet, but it may as well be.
There is of course some branching that determines how the formlet will
appear based on the properties set.

Again, I don't see how this is any different than the way the
Microsoft team coded their panel control or any other control that
needed to implement the RenderContent() or RenderChildren() methods to
allow these controls to be "wrapper" controls.

Thanks,

Jason
Nov 17 '05 #6
Jacob,

With all due respect, I think you're still missing the point. This
formlet control is not a composite control but what I'm referring to as
a "wrapper control".

Please read the following carefully and in it's entirety (I "DO"
appreciate you trying to help, by the way)...

The formlet is basically a fancy table within a table that will "WRAP"
whatever HTML you enclose within it's tags (see screenshots at
http://www.cox-internet.com/wizndaly/gg/designer.htm).

Our current non-.NET formlet is a VBScript class. In your ASP page, you
instantiate the formlet, set a few properties, call the .StartFormlet()
method, code your complex HTML, call the .EndFormlet() method, and
destroy the object. This is a shared component that is used all over
our intranet for a common look and feel, and the .NET version should
then be a custom web control in the GAC for our enterprise-wide usage.
I'm jumping ahead a little here...

EVERY formlet (and by "every" I mean thousands upon thousands on our
intranet) will have it's own (DIFFERENT) content. It is meant to be a
wrapper table.

In my opinion, we are trying to use our formlet custom control just as
it was intended - it's no different than a "panel" or a "label" or any
other "wrapper controls" but it renders some additional HTML for it's
opening and closing tags.

What the programmer "encloses" in their formlet is insignificant. It
should be able to simply handle this with RenderContent().

In a perfect world, this should allow the developer to drag and drop a
number of formlet controls onto the page in Design view, go to HTML view
and populate the contents, switch back to design view, see how it will
look, toggle some properties, etc. and NEVER lose the HTML they just
spent time coding.

Even with an arguably immature IDE such as VS .NET 2003, they should
still never lose the HTML they just spent time coding.

In my opinion, this is a serious bug in VS .NET, and a big hinderance to
our development of reusable components in an enterprise environment,
unless someone can tell me what I'm doing wrong in my use of
RenderContent(). For others viewing this thread, please see:

http://www.cox-internet.com/wizndaly/gg/designer.htm

Another way to look at this is as such...

I'm basically trying to create a custom control that will be a fancy
panel. A panel control will allow you nest as much HTML within it's
tags as your heart desires. If you start changing the properties of the
Panel control, you don't lose the "innerHTML" (forgive the client side
references) you just coded.

At some point in time, a Microsoft developer wrote the "panel" control
by inheriting "System.Web.UI.WebControls.WebControl" and coded the
following PSEUDOCODE in the Render subroutine:

output.write("<DIV>") 'or output.WriteBeginTag("DIV")
RenderContents() 'or is it MyBase.RenderContents()?
output.write("</DIV>") 'or output.WriteEndTag("DIV")

Here's my pseudocode formlet version:

output.write("<table class='...' cellpadding=...><tr><td><table
class='...'><tr><td>")
RenderContents()
output.write("</td></tr></table></td></tr></table>")

This is not at all the code for the formlet, but it may as well be.
There is of course some branching that determines how the formlet will
appear based on the properties set.

Again, I don't see how this is any different than the way the Microsoft
team coded their panel control or any other control that needed to
implement the RenderContent() or RenderChildren() methods to allow these
controls to be "wrapper" controls.

Thanks,

Jason

*** Sent via Developersdex http://www.developersdex.com ***
Don't just participate in USENET...get rewarded for it!
Nov 17 '05 #7
Here's the latest update...

I'm able to not "lose" my content by implementing an empty designer
class that inherits from ReadWriteControlDesigner rather than
inheriting from the generic ControlDesigner. However, I lose all
Design markup and my rich control appears as a Panel (DIV) in the
Design window. In my opinion, this is a temporary solution in that
you don't lose code, but not a good one for how I envisioned our
programmer/analysts creating and consuming reusable web components for
our intranet's common look and feel. I would love to see the
following:

1) the rendered HTML of the custom control in the Design pane
2) have the ability to drag and drop additional controls within the
formlet custom control (similar to panels)
3) not lose any content of the control when properties are toggled in
Design mode using the Properties pane
4) see the rendered HTML change when those properties change

Surely, this is possible.

When using the ReadWriteControlDesigner, I have achieved #2 and #3.
Without it, that is, my original code that I posted and that this web
page has documented (http://www.cox-internet.com/wizndaly/gg/designer.htm),
I'm achieving #1 and #4.

If there's a way to achieve 1,2,3 AND 4 - I need to know.

Thanks,

Jason
Nov 17 '05 #8

This is not currently a known issue with the designer so I am doing
research and escalating to our development team.

Thank you,
Greg Bybee, MCSD
Microsoft ASP.NET Developer Support

This posting is provided "AS IS" with no warranties, and confers no rights.

Please do not send email directly to this alias. This alias is for
newsgroup purposes only.

Nov 17 '05 #9
Development gave some feedback based on your description at:
http://www.cox-internet.com/wizndaly/gg/designer.htm
===========
From what I understand and can guess about this control without the full
code, it seems to be a bug in the control. There are two types of controls
- panel-like controls where the page developer adds child controls, and
composite controls where the page developer only sets properties, and the
control creates child controls dynamically. A control can't do both and get
a reasonable design-time experience.

Controls marked with ParseChildren(false), PersistChildren(true) should
also be associated with a ReadWriteControlDesigner for their designer (code
snippet indicates this isn't happening), and should not be creating child
controls programmatically (code snippet indicates the control does so).

If a control wants to create child controls programmatically, it shouldn't
have ParseChildren(false) and PersistChildren(true). In fact, the control
shouldn't need those attributes since it can inherit them from its
WebControl base class. Furthermore, from guessing a bit about the intent of
this control, it seems like the control should be implemented as a
templated control.
===========
This posting is provided "AS IS" with no warranties, and confers no rights.

Please do not send email directly to this alias. This alias is for
newsgroup purposes only.

Nov 18 '05 #10
> Development gave some feedback based on your description at:
http://www.cox-internet.com/wizndaly/gg/designer.htm
I didn't realize how outdated that page was. I've updated it, and the
existing Design View problems/dilemmas are listed at the bottom of
this page:

http://www.cox-internet.com/wizndaly/gg/designer.htm
===========
From what I understand and can guess about this control without the full
code, it seems to be a bug in the control. There are two types of controls
- panel-like controls where the page developer adds child controls, and
This is definitely a panel-like control
composite controls where the page developer only sets properties, and the
control creates child controls dynamically. A control can't do both and get
a reasonable design-time experience.
Ok, no problem. My outdated page had code left in it where I was
trying to mix the two, but that's been corrected now...

Controls marked with ParseChildren(false), PersistChildren(true) should
also be associated with a ReadWriteControlDesigner for their designer (code
snippet indicates this isn't happening), and should not be creating child
It is now...

controls programmatically (code snippet indicates the control does so).

If a control wants to create child controls programmatically, it shouldn't
have ParseChildren(false) and PersistChildren(true). In fact, the control
shouldn't need those attributes since it can inherit them from its
WebControl base class. Furthermore, from guessing a bit about the intent of
this control, it seems like the control should be implemented as a
templated control.
===========


Perhaps a templated control is exactly what I need. Unfortunately, I
haven't found a resource that can effectively explain how to create
them.

Thanks for looking into this. I sent you a zip file of the solution
as you requested in your email to me. I hope to hear back from you
soon.

Thanks again,

Jason
Nov 18 '05 #11
Hi Jason,

As I explained in my e-mail to you, I am taking over for Greg on this
issue. Can you please send the code to me? I will respond in the
newsgroup once I get info for you.

Thanks.

Jim Cheshire, MCSE, MCSD [MSFT]
Developer Support
ASP.NET
ja******@online.microsoft.com

This post is provided as-is with no warranties and confers no rights.
--------------------
From: jd****@data-tronics.com (Dales)
Newsgroups: microsoft.public.dotnet.framework.aspnet
Subject: Re: Custom web control problems in the designer pane (simple examples)Date: 19 Nov 2003 08:00:45 -0800
Organization: http://groups.google.com
Lines: 52
Message-ID: <c4**************************@posting.google.com >
References: <ms**************@cpmsftngxa06.phx.gbl> <es*************@tk2msftngp13.phx.gbl>
<c4**************************@posting.google.com >
<vZ**************@cpmsftngxa06.phx.gbl>
<6a**************@cpmsftngxa06.phx.gbl>NNTP-Posting-Host: 159.204.59.25
Content-Type: text/plain; charset=ISO-8859-1
Content-Transfer-Encoding: 8bit
X-Trace: posting.google.com 1069257645 4415 127.0.0.1 (19 Nov 2003 16:00:45 GMT)X-Complaints-To: gr**********@google.com
NNTP-Posting-Date: Wed, 19 Nov 2003 16:00:45 +0000 (UTC)
Path: cpmsftngxa07.phx.gbl!cpmsftngxa10.phx.gbl!TK2MSFTN GXA05.phx.gbl!TK2MSFTNGP08
..phx.gbl!news-out.cwix.com!newsfeed.cwix.com!news.maxwell.syr.ed u!postnews1.
google.com!not-for-mailXref: cpmsftngxa07.phx.gbl microsoft.public.dotnet.framework.aspnet:191255
X-Tomcat-NG: microsoft.public.dotnet.framework.aspnet
Development gave some feedback based on your description at:
http://www.cox-internet.com/wizndaly/gg/designer.htm
I didn't realize how outdated that page was. I've updated it, and the
existing Design View problems/dilemmas are listed at the bottom of
this page:

http://www.cox-internet.com/wizndaly/gg/designer.htm
===========
From what I understand and can guess about this control without the full
code, it seems to be a bug in the control. There are two types of controls - panel-like controls where the page developer adds child controls, and


This is definitely a panel-like control
composite controls where the page developer only sets properties, and the control creates child controls dynamically. A control can't do both and get a reasonable design-time experience.


Ok, no problem. My outdated page had code left in it where I was
trying to mix the two, but that's been corrected now...

Controls marked with ParseChildren(false), PersistChildren(true) should
also be associated with a ReadWriteControlDesigner for their designer (code snippet indicates this isn't happening), and should not be creating child
It is now...

controls programmatically (code snippet indicates the control does so).

If a control wants to create child controls programmatically, it

shouldn't have ParseChildren(false) and PersistChildren(true). In fact, the control shouldn't need those attributes since it can inherit them from its
WebControl base class. Furthermore, from guessing a bit about the intent of this control, it seems like the control should be implemented as a
templated control.
===========


Perhaps a templated control is exactly what I need. Unfortunately, I
haven't found a resource that can effectively explain how to create
them.

Thanks for looking into this. I sent you a zip file of the solution
as you requested in your email to me. I hope to hear back from you
soon.

Thanks again,

Jason


Nov 18 '05 #12
Hi Jason,

It's been many days and I haven't received your code or any word from you.
I am going to go ahead and close this issue, but if you need assistance,
please post back to this thread.

Jim Cheshire, MCSE, MCSD [MSFT]
Developer Support
ASP.NET
ja******@online.microsoft.com

This post is provided as-is with no warranties and confers no rights.
--------------------
X-Tomcat-ID: 314184656
References: <ms**************@cpmsftngxa06.phx.gbl> <es*************@tk2msftngp13.phx.gbl>
<c4**************************@posting.google.com >
<vZ**************@cpmsftngxa06.phx.gbl>
<6a**************@cpmsftngxa06.phx.gbl>
<c4**************************@posting.google.com >MIME-Version: 1.0
Content-Type: text/plain
Content-Transfer-Encoding: 7bit
From: ja******@online.microsoft.com (Jim Cheshire [MSFT])
Organization: Microsoft
Date: Fri, 21 Nov 2003 13:38:30 GMT
Subject: Re: Custom web control problems in the designer pane (simple examples)X-Tomcat-NG: microsoft.public.dotnet.framework.aspnet
Message-ID: <Ew**************@cpmsftngxa07.phx.gbl>
Newsgroups: microsoft.public.dotnet.framework.aspnet
Lines: 93
Path: cpmsftngxa07.phx.gbl
Xref: cpmsftngxa07.phx.gbl microsoft.public.dotnet.framework.aspnet:191832
NNTP-Posting-Host: tomcatimport2.phx.gbl 10.201.218.182

Hi Jason,

As I explained in my e-mail to you, I am taking over for Greg on this
issue. Can you please send the code to me? I will respond in the
newsgroup once I get info for you.

Thanks.

Jim Cheshire, MCSE, MCSD [MSFT]
Developer Support
ASP.NET
ja******@online.microsoft.com

This post is provided as-is with no warranties and confers no rights.
--------------------
From: jd****@data-tronics.com (Dales)
Newsgroups: microsoft.public.dotnet.framework.aspnet
Subject: Re: Custom web control problems in the designer pane (simpleexamples)
Date: 19 Nov 2003 08:00:45 -0800
Organization: http://groups.google.com
Lines: 52
Message-ID: <c4**************************@posting.google.com >
References: <ms**************@cpmsftngxa06.phx.gbl>

<es*************@tk2msftngp13.phx.gbl>
<c4**************************@posting.google.co m>
<vZ**************@cpmsftngxa06.phx.gbl>
<6a**************@cpmsftngxa06.phx.gbl>
NNTP-Posting-Host: 159.204.59.25
Content-Type: text/plain; charset=ISO-8859-1
Content-Transfer-Encoding: 8bit
X-Trace: posting.google.com 1069257645 4415 127.0.0.1 (19 Nov 2003

16:00:45 GMT)
X-Complaints-To: gr**********@google.com
NNTP-Posting-Date: Wed, 19 Nov 2003 16:00:45 +0000 (UTC)
Path:

cpmsftngxa07.phx.gbl!cpmsftngxa10.phx.gbl!TK2MSFT NGXA05.phx.gbl!TK2MSFTNGP0

8.phx.gbl!news-out.cwix.com!newsfeed.cwix.com!news.maxwell.syr.ed u!postnews1

Nov 18 '05 #13
Jim,

My company's mailsweeper software had quarantined my
outgoing mail (due to the script in an zip file) and I
didn't pay attention to the quarantine email notification
I received since I get them every few minutes due to
incoming spam. Sorry, that was my oversight.

I sent you the zip file again and I got your email that
you received it.

Thanks for opening this back up, and if you need anything
else from me, please let me know.

Jason
-----Original Message-----
Hi Jason,

It's been many days and I haven't received your code or any word from you.I am going to go ahead and close this issue, but if you need assistance,please post back to this thread.

Jim Cheshire, MCSE, MCSD [MSFT]
Developer Support
ASP.NET
ja******@online.microsoft.com

This post is provided as-is with no warranties and confers no rights.

--------------------
X-Tomcat-ID: 314184656
References: <ms**************@cpmsftngxa06.phx.gbl><es*************@tk2msftngp13.phx.gbl>
<c4**************************@posting.google.co m>
<vZ**************@cpmsftngxa06.phx.gbl>
<6a**************@cpmsftngxa06.phx.gbl>
<c4**************************@posting.google.co m>
MIME-Version: 1.0
Content-Type: text/plain
Content-Transfer-Encoding: 7bit
From: ja******@online.microsoft.com (Jim Cheshire [MSFT])Organization: Microsoft
Date: Fri, 21 Nov 2003 13:38:30 GMT
Subject: Re: Custom web control problems in the designer pane (simpleexamples)
X-Tomcat-NG: microsoft.public.dotnet.framework.aspnet
Message-ID: <Ew**************@cpmsftngxa07.phx.gbl>
Newsgroups: microsoft.public.dotnet.framework.aspnet
Lines: 93
Path: cpmsftngxa07.phx.gbl
Xref: cpmsftngxa07.phx.gbl
microsoft.public.dotnet.framework.aspnet:191832NNTP-Posting-Host: tomcatimport2.phx.gbl 10.201.218.182

Hi Jason,

As I explained in my e-mail to you, I am taking over for Greg on thisissue. Can you please send the code to me? I will respond in thenewsgroup once I get info for you.

Thanks.

Jim Cheshire, MCSE, MCSD [MSFT]
Developer Support
ASP.NET
ja******@online.microsoft.com

This post is provided as-is with no warranties and confers no rights.

--------------------
From: jd****@data-tronics.com (Dales)
Newsgroups: microsoft.public.dotnet.framework.aspnet
Subject: Re: Custom web control problems in the designer pane (simple
examples)
Date: 19 Nov 2003 08:00:45 -0800
Organization: http://groups.google.com
Lines: 52
Message-ID:
<c4**************************@posting.google.com >References: <ms**************@cpmsftngxa06.phx.gbl>

<es*************@tk2msftngp13.phx.gbl>
<c4**************************@posting.google.com >
<vZ**************@cpmsftngxa06.phx.gbl>
<6a**************@cpmsftngxa06.phx.gbl>
NNTP-Posting-Host: 159.204.59.25
Content-Type: text/plain; charset=ISO-8859-1
Content-Transfer-Encoding: 8bit
X-Trace: posting.google.com 1069257645 4415 127.0.0.1 (19 Nov 200316:00:45 GMT)
X-Complaints-To: gr**********@google.com
NNTP-Posting-Date: Wed, 19 Nov 2003 16:00:45 +0000

(UTC)Path:

cpmsftngxa07.phx.gbl!cpmsftngxa10.phx.gbl!

TK2MSFTNGXA05.phx.gbl!TK2MSFTNGP08
.phx.gbl!news-out.cwix.com!newsfeed.cwix.com!
news.maxwell.syr.edu!postnews1.

Nov 18 '05 #14
Jason,

Got it. I will look into this ASAP.

Jim Cheshire, MCSE, MCSD [MSFT]
Developer Support
ASP.NET
ja******@online.microsoft.com

This post is provided as-is with no warranties and confers no rights.

--------------------
Content-Class: urn:content-classes:message
From: "Jason Daley" <an*******@discussions.microsoft.com>
Sender: "Jason Daley" <an*******@discussions.microsoft.com>
References: <ms**************@cpmsftngxa06.phx.gbl> <es*************@tk2msftngp13.phx.gbl>
<c4**************************@posting.google.com >
<vZ**************@cpmsftngxa06.phx.gbl>
<6a**************@cpmsftngxa06.phx.gbl>
<c4**************************@posting.google.com >
<Ew**************@cpmsftngxa07.phx.gbl>
<Gv**************@cpmsftngxa07.phx.gbl>Subject: Re: Custom web control problems in the designer pane (simple examples)Date: Tue, 25 Nov 2003 13:45:26 -0800
Lines: 113
Message-ID: <0e****************************@phx.gbl>
MIME-Version: 1.0
Content-Type: text/plain;
charset="iso-8859-1"
Content-Transfer-Encoding: 7bit
X-Newsreader: Microsoft CDO for Windows 2000
X-MimeOLE: Produced By Microsoft MimeOLE V5.50.4910.0300
Thread-Index: AcOznW+1G/TtwxIMRb6FXzIvxCBvKQ==
Newsgroups: microsoft.public.dotnet.framework.aspnet
Path: cpmsftngxa07.phx.gbl
Xref: cpmsftngxa07.phx.gbl microsoft.public.dotnet.framework.aspnet:192743
NNTP-Posting-Host: tk2msftngxa05.phx.gbl 10.40.1.49
X-Tomcat-NG: microsoft.public.dotnet.framework.aspnet

Jim,

My company's mailsweeper software had quarantined my
outgoing mail (due to the script in an zip file) and I
didn't pay attention to the quarantine email notification
I received since I get them every few minutes due to
incoming spam. Sorry, that was my oversight.

I sent you the zip file again and I got your email that
you received it.

Thanks for opening this back up, and if you need anything
else from me, please let me know.

Jason
-----Original Message-----
Hi Jason,

It's been many days and I haven't received your code or

any word from you.
I am going to go ahead and close this issue, but if you

need assistance,
please post back to this thread.

Jim Cheshire, MCSE, MCSD [MSFT]
Developer Support
ASP.NET
ja******@online.microsoft.com

This post is provided as-is with no warranties and

confers no rights.


--------------------
X-Tomcat-ID: 314184656
References: <ms**************@cpmsftngxa06.phx.gbl>

<es*************@tk2msftngp13.phx.gbl>
<c4**************************@posting.google.com >
<vZ**************@cpmsftngxa06.phx.gbl>
<6a**************@cpmsftngxa06.phx.gbl>
<c4**************************@posting.google.com >
MIME-Version: 1.0
Content-Type: text/plain
Content-Transfer-Encoding: 7bit
From: ja******@online.microsoft.com (Jim Cheshire[MSFT])Organization: Microsoft
Date: Fri, 21 Nov 2003 13:38:30 GMT
Subject: Re: Custom web control problems in thedesigner pane (simple
examples)
X-Tomcat-NG: microsoft.public.dotnet.framework.aspnet
Message-ID: <Ew**************@cpmsftngxa07.phx.gbl>
Newsgroups: microsoft.public.dotnet.framework.aspnet
Lines: 93
Path: cpmsftngxa07.phx.gbl
Xref: cpmsftngxa07.phx.gbl

microsoft.public.dotnet.framework.aspnet:191832NNTP-Posting-Host: tomcatimport2.phx.gbl 10.201.218.182

Hi Jason,

As I explained in my e-mail to you, I am taking overfor Greg on thisissue. Can you please send the code to me? I willrespond in thenewsgroup once I get info for you.

Thanks.

Jim Cheshire, MCSE, MCSD [MSFT]
Developer Support
ASP.NET
ja******@online.microsoft.com

This post is provided as-is with no warranties andconfers no rights.

--------------------
From: jd****@data-tronics.com (Dales)
Newsgroups: microsoft.public.dotnet.framework.aspnet
Subject: Re: Custom web control problems in thedesigner pane (simpleexamples)
Date: 19 Nov 2003 08:00:45 -0800
Organization: http://groups.google.com
Lines: 52
Message-ID:<c4**************************@posting.google.co m>References: <ms**************@cpmsftngxa06.phx.gbl>
<es*************@tk2msftngp13.phx.gbl>
<c4**************************@posting.google.co m>
<vZ**************@cpmsftngxa06.phx.gbl>
<6a**************@cpmsftngxa06.phx.gbl>
NNTP-Posting-Host: 159.204.59.25
Content-Type: text/plain; charset=ISO-8859-1
Content-Transfer-Encoding: 8bit
X-Trace: posting.google.com 1069257645 4415 127.0.0.1(19 Nov 200316:00:45 GMT)
X-Complaints-To: gr**********@google.com
NNTP-Posting-Date: Wed, 19 Nov 2003 16:00:45 +0000(UTC)Path:
cpmsftngxa07.phx.gbl!cpmsftngxa10.phx.gbl!

TK2MSFTNGXA05.phx.gbl!TK2MSFTNGP0
8
.phx.gbl!news-out.cwix.com!newsfeed.cwix.com!

news.maxwell.syr.edu!postnews1
.


Nov 18 '05 #15
Hi Jason,

Sorry it has taken so long on this. We've been incredibly busy the last
few weeks.

First of all, you should be overriding RenderContents and not Render. When
you are inheriting from WebControl (which you definitely want to do because
you are rendering HTML to the page), you must override one or more of the
methods below:

AddAttribute
RenderBeginTag
RenderContents
RenderEndTag

You should not override Render because if you do, you will lose the
capabilities of the WebControl class to render HTML tags. That capability
is retained when you override RenderContents.

Secondly, your control does not appear as intended (with the styles intact)
because you are linking to a style sheet in your PreRender. The designer
doesn't know about that style sheet link, so it doesn't apply the styles.
I am looking into whether we can apply those styles somehow, but I haven't
found a way yet without explicitly linking to the style sheet in the
designer.

Third, you are specifying a DesignerAttribute in your meta data, but you
should not be doing so. You don't need a DesignerAttribute because you are
not implementing a custom designer. The build-in designer for server
controls provides you with all of the functionality that you need.

I will follow-up with information on the styles as soon as I have it worked
out.

Jim Cheshire, MCSE, MCSD [MSFT]
Developer Support
ASP.NET
ja******@online.microsoft.com

This post is provided as-is with no warranties and confers no rights.

--------------------
X-Tomcat-ID: 737891285
References: <ms**************@cpmsftngxa06.phx.gbl> <es*************@tk2msftngp13.phx.gbl>
<c4**************************@posting.google.com >
<vZ**************@cpmsftngxa06.phx.gbl>
<6a**************@cpmsftngxa06.phx.gbl>
<c4**************************@posting.google.com >
<Ew**************@cpmsftngxa07.phx.gbl>
<Gv**************@cpmsftngxa07.phx.gbl>
<0e****************************@phx.gbl>MIME-Version: 1.0
Content-Type: text/plain
Content-Transfer-Encoding: 7bit
From: ja******@online.microsoft.com (Jim Cheshire [MSFT])
Organization: Microsoft
Date: Wed, 26 Nov 2003 23:37:26 GMT
Subject: Re: Custom web control problems in the designer pane (simple examples)X-Tomcat-NG: microsoft.public.dotnet.framework.aspnet
Message-ID: <V4**************@cpmsftngxa06.phx.gbl>
Newsgroups: microsoft.public.dotnet.framework.aspnet
Lines: 127
Path: cpmsftngxa06.phx.gbl
Xref: cpmsftngxa06.phx.gbl microsoft.public.dotnet.framework.aspnet:193618
NNTP-Posting-Host: tomcatimport2.phx.gbl 10.201.218.182

Jason,

Got it. I will look into this ASAP.

Jim Cheshire, MCSE, MCSD [MSFT]
Developer Support
ASP.NET
ja******@online.microsoft.com

This post is provided as-is with no warranties and confers no rights.

--------------------
Content-Class: urn:content-classes:message
From: "Jason Daley" <an*******@discussions.microsoft.com>
Sender: "Jason Daley" <an*******@discussions.microsoft.com>
References: <ms**************@cpmsftngxa06.phx.gbl>

<es*************@tk2msftngp13.phx.gbl>
<c4**************************@posting.google.co m>
<vZ**************@cpmsftngxa06.phx.gbl>
<6a**************@cpmsftngxa06.phx.gbl>
<c4**************************@posting.google.co m>
<Ew**************@cpmsftngxa07.phx.gbl>
<Gv**************@cpmsftngxa07.phx.gbl>
Subject: Re: Custom web control problems in the designer pane (simple

examples)
Date: Tue, 25 Nov 2003 13:45:26 -0800
Lines: 113
Message-ID: <0e****************************@phx.gbl>
MIME-Version: 1.0
Content-Type: text/plain;
charset="iso-8859-1"
Content-Transfer-Encoding: 7bit
X-Newsreader: Microsoft CDO for Windows 2000
X-MimeOLE: Produced By Microsoft MimeOLE V5.50.4910.0300
Thread-Index: AcOznW+1G/TtwxIMRb6FXzIvxCBvKQ==
Newsgroups: microsoft.public.dotnet.framework.aspnet
Path: cpmsftngxa07.phx.gbl
Xref: cpmsftngxa07.phx.gbl microsoft.public.dotnet.framework.aspnet:192743
NNTP-Posting-Host: tk2msftngxa05.phx.gbl 10.40.1.49
X-Tomcat-NG: microsoft.public.dotnet.framework.aspnet

Jim,

My company's mailsweeper software had quarantined my
outgoing mail (due to the script in an zip file) and I
didn't pay attention to the quarantine email notification
I received since I get them every few minutes due to
incoming spam. Sorry, that was my oversight.

I sent you the zip file again and I got your email that
you received it.

Thanks for opening this back up, and if you need anything
else from me, please let me know.

Jason
-----Original Message-----
Hi Jason,

It's been many days and I haven't received your code or

any word from you.
I am going to go ahead and close this issue, but if you

need assistance,
please post back to this thread.

Jim Cheshire, MCSE, MCSD [MSFT]
Developer Support
ASP.NET
ja******@online.microsoft.com

This post is provided as-is with no warranties and

confers no rights.


--------------------
X-Tomcat-ID: 314184656
References: <ms**************@cpmsftngxa06.phx.gbl>
<es*************@tk2msftngp13.phx.gbl>
<c4**************************@posting.google.co m>
<vZ**************@cpmsftngxa06.phx.gbl>
<6a**************@cpmsftngxa06.phx.gbl>
<c4**************************@posting.google.co m>
MIME-Version: 1.0
Content-Type: text/plain
Content-Transfer-Encoding: 7bit
From: ja******@online.microsoft.com (Jim Cheshire

[MSFT])
Organization: Microsoft
Date: Fri, 21 Nov 2003 13:38:30 GMT
Subject: Re: Custom web control problems in the

designer pane (simple
examples)
X-Tomcat-NG: microsoft.public.dotnet.framework.aspnet
Message-ID: <Ew**************@cpmsftngxa07.phx.gbl>
Newsgroups: microsoft.public.dotnet.framework.aspnet
Lines: 93
Path: cpmsftngxa07.phx.gbl
Xref: cpmsftngxa07.phx.gbl

microsoft.public.dotnet.framework.aspnet:19183 2
NNTP-Posting-Host: tomcatimport2.phx.gbl 10.201.218.182

Hi Jason,

As I explained in my e-mail to you, I am taking over

for Greg on this
issue. Can you please send the code to me? I will

respond in the
newsgroup once I get info for you.

Thanks.

Jim Cheshire, MCSE, MCSD [MSFT]
Developer Support
ASP.NET
ja******@online.microsoft.com

This post is provided as-is with no warranties and

confers no rights.


--------------------
>From: jd****@data-tronics.com (Dales)
>Newsgroups: microsoft.public.dotnet.framework.aspnet
>Subject: Re: Custom web control problems in the

designer pane (simple
examples)
>Date: 19 Nov 2003 08:00:45 -0800
>Organization: http://groups.google.com
>Lines: 52
>Message-ID:

<c4**************************@posting.google.com >
>References: <ms**************@cpmsftngxa06.phx.gbl>
<es*************@tk2msftngp13.phx.gbl>
<c4**************************@posting.google.c om>
<vZ**************@cpmsftngxa06.phx.gbl>
<6a**************@cpmsftngxa06.phx.gbl>
>NNTP-Posting-Host: 159.204.59.25
>Content-Type: text/plain; charset=ISO-8859-1
>Content-Transfer-Encoding: 8bit
>X-Trace: posting.google.com 1069257645 4415 127.0.0.1

(19 Nov 2003
16:00:45 GMT)
>X-Complaints-To: gr**********@google.com
>NNTP-Posting-Date: Wed, 19 Nov 2003 16:00:45 +0000

(UTC)
>Path:
cpmsftngxa07.phx.gbl!cpmsftngxa10.phx.gbl!

TK2MSFTNGXA05.phx.gbl!TK2MSFTNGP0
8
.phx.gbl!news-out.cwix.com!newsfeed.cwix.com!

news.maxwell.syr.edu!postnews1
.



Nov 18 '05 #16
Hi Jason,

In addition to the changes in the message below, you can implement the
following code to make your styles appear. At the end of the RenderContent
method, add the following:

If HttpContext.Current Is Nothing Then
output.Write("<LINK href=""newStyle.css"" type=""text/css""
rel=""stylesheet"">")
output.Write("<LINK href=""DTCIntraStyle.css?v5.1""
type=""text/css"" rel=""STYLESHEET"">")
End If

What this does is explicitly write out the style sheet links when you are
in the designer only. That will cause your formatting applied by your CSS
classes to persist to the page.

Jim Cheshire, MCSE, MCSD [MSFT]
Developer Support
ASP.NET
ja******@online.microsoft.com

This post is provided as-is with no warranties and confers no rights.

--------------------
X-Tomcat-ID: 541365211
References: <ms**************@cpmsftngxa06.phx.gbl> <es*************@tk2msftngp13.phx.gbl>
<c4**************************@posting.google.com >
<vZ**************@cpmsftngxa06.phx.gbl>
<6a**************@cpmsftngxa06.phx.gbl>
<c4**************************@posting.google.com >
<Ew**************@cpmsftngxa07.phx.gbl>
<Gv**************@cpmsftngxa07.phx.gbl>
<0e****************************@phx.gbl>
<V4**************@cpmsftngxa06.phx.gbl>MIME-Version: 1.0
Content-Type: text/plain
Content-Transfer-Encoding: 7bit
From: ja******@online.microsoft.com (Jim Cheshire [MSFT])
Organization: Microsoft
Date: Tue, 02 Dec 2003 18:08:34 GMT
Subject: Re: Custom web control problems in the designer pane (simple examples)X-Tomcat-NG: microsoft.public.dotnet.framework.aspnet
Message-ID: <SP**************@cpmsftngxa06.phx.gbl>
Newsgroups: microsoft.public.dotnet.framework.aspnet
Lines: 197
Path: cpmsftngxa06.phx.gbl
Xref: cpmsftngxa06.phx.gbl microsoft.public.dotnet.framework.aspnet:194527
NNTP-Posting-Host: TOMCATIMPORT1 10.201.218.122

Hi Jason,

Sorry it has taken so long on this. We've been incredibly busy the last
few weeks.

First of all, you should be overriding RenderContents and not Render. Whenyou are inheriting from WebControl (which you definitely want to do becauseyou are rendering HTML to the page), you must override one or more of the
methods below:

AddAttribute
RenderBeginTag
RenderContents
RenderEndTag

You should not override Render because if you do, you will lose the
capabilities of the WebControl class to render HTML tags. That capability
is retained when you override RenderContents.

Secondly, your control does not appear as intended (with the styles intact)because you are linking to a style sheet in your PreRender. The designer
doesn't know about that style sheet link, so it doesn't apply the styles.
I am looking into whether we can apply those styles somehow, but I haven't
found a way yet without explicitly linking to the style sheet in the
designer.

Third, you are specifying a DesignerAttribute in your meta data, but you
should not be doing so. You don't need a DesignerAttribute because you arenot implementing a custom designer. The build-in designer for server
controls provides you with all of the functionality that you need.

I will follow-up with information on the styles as soon as I have it workedout.

Jim Cheshire, MCSE, MCSD [MSFT]
Developer Support
ASP.NET
ja******@online.microsoft.com

This post is provided as-is with no warranties and confers no rights.

--------------------
X-Tomcat-ID: 737891285
References: <ms**************@cpmsftngxa06.phx.gbl>

<es*************@tk2msftngp13.phx.gbl>
<c4**************************@posting.google.co m>
<vZ**************@cpmsftngxa06.phx.gbl>
<6a**************@cpmsftngxa06.phx.gbl>
<c4**************************@posting.google.co m>
<Ew**************@cpmsftngxa07.phx.gbl>
<Gv**************@cpmsftngxa07.phx.gbl>
<0e****************************@phx.gbl>
MIME-Version: 1.0
Content-Type: text/plain
Content-Transfer-Encoding: 7bit
From: ja******@online.microsoft.com (Jim Cheshire [MSFT])
Organization: Microsoft
Date: Wed, 26 Nov 2003 23:37:26 GMT
Subject: Re: Custom web control problems in the designer pane (simple

examples)
X-Tomcat-NG: microsoft.public.dotnet.framework.aspnet
Message-ID: <V4**************@cpmsftngxa06.phx.gbl>
Newsgroups: microsoft.public.dotnet.framework.aspnet
Lines: 127
Path: cpmsftngxa06.phx.gbl
Xref: cpmsftngxa06.phx.gbl microsoft.public.dotnet.framework.aspnet:193618
NNTP-Posting-Host: tomcatimport2.phx.gbl 10.201.218.182

Jason,

Got it. I will look into this ASAP.

Jim Cheshire, MCSE, MCSD [MSFT]
Developer Support
ASP.NET
ja******@online.microsoft.com

This post is provided as-is with no warranties and confers no rights.

--------------------
Content-Class: urn:content-classes:message
From: "Jason Daley" <an*******@discussions.microsoft.com>
Sender: "Jason Daley" <an*******@discussions.microsoft.com>
References: <ms**************@cpmsftngxa06.phx.gbl>

<es*************@tk2msftngp13.phx.gbl>
<c4**************************@posting.google.com >
<vZ**************@cpmsftngxa06.phx.gbl>
<6a**************@cpmsftngxa06.phx.gbl>
<c4**************************@posting.google.com >
<Ew**************@cpmsftngxa07.phx.gbl>
<Gv**************@cpmsftngxa07.phx.gbl>
Subject: Re: Custom web control problems in the designer pane (simple

examples)
Date: Tue, 25 Nov 2003 13:45:26 -0800
Lines: 113
Message-ID: <0e****************************@phx.gbl>
MIME-Version: 1.0
Content-Type: text/plain;
charset="iso-8859-1"
Content-Transfer-Encoding: 7bit
X-Newsreader: Microsoft CDO for Windows 2000
X-MimeOLE: Produced By Microsoft MimeOLE V5.50.4910.0300
Thread-Index: AcOznW+1G/TtwxIMRb6FXzIvxCBvKQ==
Newsgroups: microsoft.public.dotnet.framework.aspnet
Path: cpmsftngxa07.phx.gbl
Xref: cpmsftngxa07.phx.gbl microsoft.public.dotnet.framework.aspnet:192743NNTP-Posting-Host: tk2msftngxa05.phx.gbl 10.40.1.49
X-Tomcat-NG: microsoft.public.dotnet.framework.aspnet

Jim,

My company's mailsweeper software had quarantined my
outgoing mail (due to the script in an zip file) and I
didn't pay attention to the quarantine email notification
I received since I get them every few minutes due to
incoming spam. Sorry, that was my oversight.

I sent you the zip file again and I got your email that
you received it.

Thanks for opening this back up, and if you need anything
else from me, please let me know.

Jason

-----Original Message-----
Hi Jason,

It's been many days and I haven't received your code or
any word from you.
I am going to go ahead and close this issue, but if you
need assistance,
please post back to this thread.

Jim Cheshire, MCSE, MCSD [MSFT]
Developer Support
ASP.NET
ja******@online.microsoft.com

This post is provided as-is with no warranties and
confers no rights.
--------------------
>X-Tomcat-ID: 314184656
>References: <ms**************@cpmsftngxa06.phx.gbl>
<es*************@tk2msftngp13.phx.gbl>
<c4**************************@posting.google.c om>
<vZ**************@cpmsftngxa06.phx.gbl>
<6a**************@cpmsftngxa06.phx.gbl>
<c4**************************@posting.google.c om>
>MIME-Version: 1.0
>Content-Type: text/plain
>Content-Transfer-Encoding: 7bit
>From: ja******@online.microsoft.com (Jim Cheshire
[MSFT])
>Organization: Microsoft
>Date: Fri, 21 Nov 2003 13:38:30 GMT
>Subject: Re: Custom web control problems in the
designer pane (simple
examples)
>X-Tomcat-NG: microsoft.public.dotnet.framework.aspnet
>Message-ID: <Ew**************@cpmsftngxa07.phx.gbl>
>Newsgroups: microsoft.public.dotnet.framework.aspnet
>Lines: 93
>Path: cpmsftngxa07.phx.gbl
>Xref: cpmsftngxa07.phx.gbl
microsoft.public.dotnet.framework.aspnet:1918 32
>NNTP-Posting-Host: tomcatimport2.phx.gbl 10.201.218.182
>
>Hi Jason,
>
>As I explained in my e-mail to you, I am taking over
for Greg on this
>issue. Can you please send the code to me? I will
respond in the
>newsgroup once I get info for you.
>
>Thanks.
>
>Jim Cheshire, MCSE, MCSD [MSFT]
>Developer Support
>ASP.NET
>ja******@online.microsoft.com
>
>This post is provided as-is with no warranties and
confers no rights.
>
>
>--------------------
>>From: jd****@data-tronics.com (Dales)
>>Newsgroups: microsoft.public.dotnet.framework.aspnet
>>Subject: Re: Custom web control problems in the
designer pane (simple
>examples)
>>Date: 19 Nov 2003 08:00:45 -0800
>>Organization: http://groups.google.com
>>Lines: 52
>>Message-ID:
<c4**************************@posting.google.co m>
>>References: <ms**************@cpmsftngxa06.phx.gbl>
><es*************@tk2msftngp13.phx.gbl>
><c4**************************@posting.google. com>
><vZ**************@cpmsftngxa06.phx.gbl>
><6a**************@cpmsftngxa06.phx.gbl>
>>NNTP-Posting-Host: 159.204.59.25
>>Content-Type: text/plain; charset=ISO-8859-1
>>Content-Transfer-Encoding: 8bit
>>X-Trace: posting.google.com 1069257645 4415 127.0.0.1
(19 Nov 2003
>16:00:45 GMT)
>>X-Complaints-To: gr**********@google.com
>>NNTP-Posting-Date: Wed, 19 Nov 2003 16:00:45 +0000
(UTC)
>>Path:
>cpmsftngxa07.phx.gbl!cpmsftngxa10.phx.gbl!
TK2MSFTNGXA05.phx.gbl!TK2MSFTNGP0
8
>.phx.gbl!news-out.cwix.com!newsfeed.cwix.com!
news.maxwell.syr.edu!postnews1
.




Nov 18 '05 #17
Jim,

I applied all of your suggestions and what I have now is
a control that looks perfect when I drag and drop a new
one onto the page.

However, as soon as I change a property of the control in
the design pane, I lose my contents that the
control "wraps". This problem seemed to have been fixed
by implementing a ReadWriteControlDesigner, but you
suggested I don't need to implement a designer.

When I use a designer, I'm able to add controls and HTML
to my control in the Design Pane, but my control doesn't
render - it looks like a panel. I lose it's rendering.

I need for this control to do the following:

1. Allow html and/or controls to be added either
programatically or via the Design Pane to the "contents"
of the control.

2. Graphically reflect changes when the properties are
toggled in the Design pane (it's now doing this, but
destroying my contents).

Right now it's achieving #2, but not #1, and I need both.

I'm emailing you my current solution again with the
changes you suggested.

Thanks,

Jason
-----Original Message-----
Hi Jason,

In addition to the changes in the message below, you can implement thefollowing code to make your styles appear. At the end of the RenderContentmethod, add the following:

If HttpContext.Current Is Nothing Then
output.Write("<LINK href=""newStyle.css"" type=""text/css""rel=""stylesheet"">")
output.Write("<LINK href=""DTCIntraStyle.css? v5.1""type=""text/css"" rel=""STYLESHEET"">")
End If

What this does is explicitly write out the style sheet links when you arein the designer only. That will cause your formatting applied by your CSSclasses to persist to the page.

Jim Cheshire, MCSE, MCSD [MSFT]
Developer Support
ASP.NET
ja******@online.microsoft.com

This post is provided as-is with no warranties and confers no rights.
--------------------
X-Tomcat-ID: 541365211
References: <ms**************@cpmsftngxa06.phx.gbl><es*************@tk2msftngp13.phx.gbl>
<c4**************************@posting.google.co m>
<vZ**************@cpmsftngxa06.phx.gbl>
<6a**************@cpmsftngxa06.phx.gbl>
<c4**************************@posting.google.co m>
<Ew**************@cpmsftngxa07.phx.gbl>
<Gv**************@cpmsftngxa07.phx.gbl>
<0e****************************@phx.gbl>
<V4**************@cpmsftngxa06.phx.gbl>
MIME-Version: 1.0
Content-Type: text/plain
Content-Transfer-Encoding: 7bit
From: ja******@online.microsoft.com (Jim Cheshire [MSFT])Organization: Microsoft
Date: Tue, 02 Dec 2003 18:08:34 GMT
Subject: Re: Custom web control problems in the designer pane (simpleexamples)
X-Tomcat-NG: microsoft.public.dotnet.framework.aspnet
Message-ID: <SP**************@cpmsftngxa06.phx.gbl>
Newsgroups: microsoft.public.dotnet.framework.aspnet
Lines: 197
Path: cpmsftngxa06.phx.gbl
Xref: cpmsftngxa06.phx.gbl
microsoft.public.dotnet.framework.aspnet:194527NNTP-Posting-Host: TOMCATIMPORT1 10.201.218.122

Hi Jason,

Sorry it has taken so long on this. We've been incredibly busy the lastfew weeks.

First of all, you should be overriding RenderContents and not Render.When
you are inheriting from WebControl (which you
definitely want to dobecause
you are rendering HTML to the page), you must override
one or more of themethods below:

AddAttribute
RenderBeginTag
RenderContents
RenderEndTag

You should not override Render because if you do, you will lose thecapabilities of the WebControl class to render HTML tags. That capabilityis retained when you override RenderContents.

Secondly, your control does not appear as intended (with the stylesintact)
because you are linking to a style sheet in your
PreRender. The designerdoesn't know about that style sheet link, so it doesn't apply the styles.I am looking into whether we can apply those styles somehow, but I haven'tfound a way yet without explicitly linking to the style sheet in thedesigner.

Third, you are specifying a DesignerAttribute in your meta data, but youshould not be doing so. You don't need a DesignerAttribute because youare
not implementing a custom designer. The build-in
designer for servercontrols provides you with all of the functionality that you need.
I will follow-up with information on the styles as soon as I have itworked
out.

Jim Cheshire, MCSE, MCSD [MSFT]
Developer Support
ASP.NET
ja******@online.microsoft.com

This post is provided as-is with no warranties and

confers no rights.


Nov 18 '05 #18
Jason,

In that case, you would be much better off implementing this as a templated
control.

This case has moved outside of what we can deal with in a newsgroup issue
and is not moving into the Advisory realm. If you need additional support
for your control, we can review the options if you'll open a case with us.

Thanks.

Jim Cheshire, MCSE, MCSD [MSFT]
Developer Support
ASP.NET
ja******@online.microsoft.com

This post is provided as-is with no warranties and confers no rights.

--------------------
Content-Class: urn:content-classes:message
From: "Jason" <an*******@discussions.microsoft.com>
Sender: "Jason" <an*******@discussions.microsoft.com>
References: <ms**************@cpmsftngxa06.phx.gbl> <es*************@tk2msftngp13.phx.gbl>
<c4**************************@posting.google.com >
<vZ**************@cpmsftngxa06.phx.gbl>
<6a**************@cpmsftngxa06.phx.gbl>
<c4**************************@posting.google.com >
<Ew**************@cpmsftngxa07.phx.gbl>
<Gv**************@cpmsftngxa07.phx.gbl>
<0e****************************@phx.gbl>
<V4**************@cpmsftngxa06.phx.gbl>
<SP**************@cpmsftngxa06.phx.gbl>
<Vt**************@cpmsftngxa06.phx.gbl>Subject: Re: Custom web control problems in the designer pane (simple examples)Date: Wed, 3 Dec 2003 14:04:26 -0800
Lines: 162
Message-ID: <16****************************@phx.gbl>
MIME-Version: 1.0
Content-Type: text/plain;
charset="iso-8859-1"
Content-Transfer-Encoding: 7bit
X-Newsreader: Microsoft CDO for Windows 2000
Thread-Index: AcO56WrG2Z8bSfQYSKCvnw+SjWxiBw==
X-MimeOLE: Produced By Microsoft MimeOLE V5.50.4910.0300
Newsgroups: microsoft.public.dotnet.framework.aspnet
Path: cpmsftngxa06.phx.gbl
Xref: cpmsftngxa06.phx.gbl microsoft.public.dotnet.framework.aspnet:194876
NNTP-Posting-Host: tk2msftngxs01.phx.gbl 10.40.2.125
X-Tomcat-NG: microsoft.public.dotnet.framework.aspnet

Jim,

I applied all of your suggestions and what I have now is
a control that looks perfect when I drag and drop a new
one onto the page.

However, as soon as I change a property of the control in
the design pane, I lose my contents that the
control "wraps". This problem seemed to have been fixed
by implementing a ReadWriteControlDesigner, but you
suggested I don't need to implement a designer.

When I use a designer, I'm able to add controls and HTML
to my control in the Design Pane, but my control doesn't
render - it looks like a panel. I lose it's rendering.

I need for this control to do the following:

1. Allow html and/or controls to be added either
programatically or via the Design Pane to the "contents"
of the control.

2. Graphically reflect changes when the properties are
toggled in the Design pane (it's now doing this, but
destroying my contents).

Right now it's achieving #2, but not #1, and I need both.

I'm emailing you my current solution again with the
changes you suggested.

Thanks,

Jason
-----Original Message-----
Hi Jason,

In addition to the changes in the message below, you can

implement the
following code to make your styles appear. At the end

of the RenderContent
method, add the following:

If HttpContext.Current Is Nothing Then
output.Write("<LINK href=""newStyle.css""

type=""text/css""
rel=""stylesheet"">")
output.Write("<LINK href=""DTCIntraStyle.css?

v5.1""
type=""text/css"" rel=""STYLESHEET"">")
End If

What this does is explicitly write out the style sheet

links when you are
in the designer only. That will cause your formatting

applied by your CSS
classes to persist to the page.

Jim Cheshire, MCSE, MCSD [MSFT]
Developer Support
ASP.NET
ja******@online.microsoft.com

This post is provided as-is with no warranties and

confers no rights.

--------------------
X-Tomcat-ID: 541365211
References: <ms**************@cpmsftngxa06.phx.gbl>

<es*************@tk2msftngp13.phx.gbl>
<c4**************************@posting.google.com >
<vZ**************@cpmsftngxa06.phx.gbl>
<6a**************@cpmsftngxa06.phx.gbl>
<c4**************************@posting.google.com >
<Ew**************@cpmsftngxa07.phx.gbl>
<Gv**************@cpmsftngxa07.phx.gbl>
<0e****************************@phx.gbl>
<V4**************@cpmsftngxa06.phx.gbl>
MIME-Version: 1.0
Content-Type: text/plain
Content-Transfer-Encoding: 7bit
From: ja******@online.microsoft.com (Jim Cheshire[MSFT])Organization: Microsoft
Date: Tue, 02 Dec 2003 18:08:34 GMT
Subject: Re: Custom web control problems in thedesigner pane (simple
examples)
X-Tomcat-NG: microsoft.public.dotnet.framework.aspnet
Message-ID: <SP**************@cpmsftngxa06.phx.gbl>
Newsgroups: microsoft.public.dotnet.framework.aspnet
Lines: 197
Path: cpmsftngxa06.phx.gbl
Xref: cpmsftngxa06.phx.gbl

microsoft.public.dotnet.framework.aspnet:194527NNTP-Posting-Host: TOMCATIMPORT1 10.201.218.122

Hi Jason,

Sorry it has taken so long on this. We've beenincredibly busy the lastfew weeks.

First of all, you should be overriding RenderContentsand not Render.
When
you are inheriting from WebControl (which you

definitely want to do
because
you are rendering HTML to the page), you must override

one or more of themethods below:

AddAttribute
RenderBeginTag
RenderContents
RenderEndTag

You should not override Render because if you do, youwill lose thecapabilities of the WebControl class to render HTMLtags. That capabilityis retained when you override RenderContents.

Secondly, your control does not appear as intended(with the styles
intact)
because you are linking to a style sheet in your

PreRender. The designerdoesn't know about that style sheet link, so it doesn'tapply the styles.I am looking into whether we can apply those stylessomehow, but I haven'tfound a way yet without explicitly linking to the stylesheet in thedesigner.

Third, you are specifying a DesignerAttribute in yourmeta data, but youshould not be doing so. You don't need aDesignerAttribute because you
are
not implementing a custom designer. The build-in

designer for servercontrols provides you with all of the functionalitythat you need.
I will follow-up with information on the styles as soonas I have it
worked
out.

Jim Cheshire, MCSE, MCSD [MSFT]
Developer Support
ASP.NET
ja******@online.microsoft.com

This post is provided as-is with no warranties and

confers no rights.



Nov 18 '05 #19
Jason,

In that case, you would be much better off implementing this as a templated
control.

This case has moved outside of what we can deal with in a newsgroup issue
and is not moving into the Advisory realm. If you need additional support
for your control, we can review the options if you'll open a case with us.

Thanks.

Jim Cheshire, MCSE, MCSD [MSFT]
Developer Support
ASP.NET
ja******@online.microsoft.com

This post is provided as-is with no warranties and confers no rights.

--------------------
Content-Class: urn:content-classes:message
From: "Jason" <an*******@discussions.microsoft.com>
Sender: "Jason" <an*******@discussions.microsoft.com>
References: <ms**************@cpmsftngxa06.phx.gbl> <es*************@tk2msftngp13.phx.gbl>
<c4**************************@posting.google.com >
<vZ**************@cpmsftngxa06.phx.gbl>
<6a**************@cpmsftngxa06.phx.gbl>
<c4**************************@posting.google.com >
<Ew**************@cpmsftngxa07.phx.gbl>
<Gv**************@cpmsftngxa07.phx.gbl>
<0e****************************@phx.gbl>
<V4**************@cpmsftngxa06.phx.gbl>
<SP**************@cpmsftngxa06.phx.gbl>
<Vt**************@cpmsftngxa06.phx.gbl>Subject: Re: Custom web control problems in the designer pane (simple examples)Date: Wed, 3 Dec 2003 14:04:26 -0800
Lines: 162
Message-ID: <16****************************@phx.gbl>
MIME-Version: 1.0
Content-Type: text/plain;
charset="iso-8859-1"
Content-Transfer-Encoding: 7bit
X-Newsreader: Microsoft CDO for Windows 2000
Thread-Index: AcO56WrG2Z8bSfQYSKCvnw+SjWxiBw==
X-MimeOLE: Produced By Microsoft MimeOLE V5.50.4910.0300
Newsgroups: microsoft.public.dotnet.framework.aspnet
Path: cpmsftngxa06.phx.gbl
Xref: cpmsftngxa06.phx.gbl microsoft.public.dotnet.framework.aspnet:194876
NNTP-Posting-Host: tk2msftngxs01.phx.gbl 10.40.2.125
X-Tomcat-NG: microsoft.public.dotnet.framework.aspnet

Jim,

I applied all of your suggestions and what I have now is
a control that looks perfect when I drag and drop a new
one onto the page.

However, as soon as I change a property of the control in
the design pane, I lose my contents that the
control "wraps". This problem seemed to have been fixed
by implementing a ReadWriteControlDesigner, but you
suggested I don't need to implement a designer.

When I use a designer, I'm able to add controls and HTML
to my control in the Design Pane, but my control doesn't
render - it looks like a panel. I lose it's rendering.

I need for this control to do the following:

1. Allow html and/or controls to be added either
programatically or via the Design Pane to the "contents"
of the control.

2. Graphically reflect changes when the properties are
toggled in the Design pane (it's now doing this, but
destroying my contents).

Right now it's achieving #2, but not #1, and I need both.

I'm emailing you my current solution again with the
changes you suggested.

Thanks,

Jason
-----Original Message-----
Hi Jason,

In addition to the changes in the message below, you can

implement the
following code to make your styles appear. At the end

of the RenderContent
method, add the following:

If HttpContext.Current Is Nothing Then
output.Write("<LINK href=""newStyle.css""

type=""text/css""
rel=""stylesheet"">")
output.Write("<LINK href=""DTCIntraStyle.css?

v5.1""
type=""text/css"" rel=""STYLESHEET"">")
End If

What this does is explicitly write out the style sheet

links when you are
in the designer only. That will cause your formatting

applied by your CSS
classes to persist to the page.

Jim Cheshire, MCSE, MCSD [MSFT]
Developer Support
ASP.NET
ja******@online.microsoft.com

This post is provided as-is with no warranties and

confers no rights.

--------------------
X-Tomcat-ID: 541365211
References: <ms**************@cpmsftngxa06.phx.gbl>

<es*************@tk2msftngp13.phx.gbl>
<c4**************************@posting.google.com >
<vZ**************@cpmsftngxa06.phx.gbl>
<6a**************@cpmsftngxa06.phx.gbl>
<c4**************************@posting.google.com >
<Ew**************@cpmsftngxa07.phx.gbl>
<Gv**************@cpmsftngxa07.phx.gbl>
<0e****************************@phx.gbl>
<V4**************@cpmsftngxa06.phx.gbl>
MIME-Version: 1.0
Content-Type: text/plain
Content-Transfer-Encoding: 7bit
From: ja******@online.microsoft.com (Jim Cheshire[MSFT])Organization: Microsoft
Date: Tue, 02 Dec 2003 18:08:34 GMT
Subject: Re: Custom web control problems in thedesigner pane (simple
examples)
X-Tomcat-NG: microsoft.public.dotnet.framework.aspnet
Message-ID: <SP**************@cpmsftngxa06.phx.gbl>
Newsgroups: microsoft.public.dotnet.framework.aspnet
Lines: 197
Path: cpmsftngxa06.phx.gbl
Xref: cpmsftngxa06.phx.gbl

microsoft.public.dotnet.framework.aspnet:194527NNTP-Posting-Host: TOMCATIMPORT1 10.201.218.122

Hi Jason,

Sorry it has taken so long on this. We've beenincredibly busy the lastfew weeks.

First of all, you should be overriding RenderContentsand not Render.
When
you are inheriting from WebControl (which you

definitely want to do
because
you are rendering HTML to the page), you must override

one or more of themethods below:

AddAttribute
RenderBeginTag
RenderContents
RenderEndTag

You should not override Render because if you do, youwill lose thecapabilities of the WebControl class to render HTMLtags. That capabilityis retained when you override RenderContents.

Secondly, your control does not appear as intended(with the styles
intact)
because you are linking to a style sheet in your

PreRender. The designerdoesn't know about that style sheet link, so it doesn'tapply the styles.I am looking into whether we can apply those stylessomehow, but I haven'tfound a way yet without explicitly linking to the stylesheet in thedesigner.

Third, you are specifying a DesignerAttribute in yourmeta data, but youshould not be doing so. You don't need aDesignerAttribute because you
are
not implementing a custom designer. The build-in

designer for servercontrols provides you with all of the functionalitythat you need.
I will follow-up with information on the styles as soonas I have it
worked
out.

Jim Cheshire, MCSE, MCSD [MSFT]
Developer Support
ASP.NET
ja******@online.microsoft.com

This post is provided as-is with no warranties and

confers no rights.



Nov 18 '05 #20

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

6
by: Suzanne | last post by:
Hi all, I really hope someone out there can help me as I've been tearing my hair out on this one for a good while and I'm getting really frustrated now! My problem is this - my custom...
2
by: Suzanne | last post by:
Hi all, I'm reposting this message as I'm experiencing this problem more and more frequently : I really hope someone out there can help me as I've been tearing my hair out on this one for a...
11
by: Pete Kane | last post by:
Hi All, does anyone know how to add TabPages of ones own classes at design time ? ideally when adding a new TabControl it would contain tab pages of my own classes, I know you can achieve this with...
15
by: rizwanahmed24 | last post by:
Hello i have made a custom control. i have placed a panel on it. I want this panel to behave just like the normal panel. The problem i was having is that the panel on my custom control doesnt...
0
by: ChopStickr | last post by:
I have a custom control that is embedded (using the object tag) in an html document. The control takes a path to a local client ini file. Reads the file. Executes the program specified in...
3
by: RichB | last post by:
I would like to use the AJAX ASP.NET Accordion Control. Can I create a user control for the form and include this within a custom control which inherits from a Pane of the Accordion control? I...
4
by: =?Utf-8?B?UmljaEI=?= | last post by:
I am trying to create a project using the ASP.NET AJAX accordion control. I would like to dynamically add panes to the control with a form template added when the pane is added. I have tried...
2
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 7 Feb 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:30 (7.30PM). In this month's session, the creator of the excellent VBE...
0
by: Aftab Ahmad | last post by:
Hello Experts! I have written a code in MS Access for a cmd called "WhatsApp Message" to open WhatsApp using that very code but the problem is that it gives a popup message everytime I clicked on...
0
by: ryjfgjl | last post by:
ExcelToDatabase: batch import excel into database automatically...
0
by: marcoviolo | last post by:
Dear all, I would like to implement on my worksheet an vlookup dynamic , that consider a change of pivot excel via win32com, from an external excel (without open it) and save the new file into a...
1
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: Vimpel783 | last post by:
Hello! Guys, I found this code on the Internet, but I need to modify it a little. It works well, the problem is this: Data is sent from only one cell, in this case B5, but it is necessary that data...
0
by: jfyes | last post by:
As a hardware engineer, after seeing that CEIWEI recently released a new tool for Modbus RTU Over TCP/UDP filtering and monitoring, I actively went to its official website to take a look. It turned...
0
by: ArrayDB | last post by:
The error message I've encountered is; ERROR:root:Error generating model response: exception: access violation writing 0x0000000000005140, which seems to be indicative of an access violation...
1
by: PapaRatzi | last post by:
Hello, I am teaching myself MS Access forms design and Visual Basic. I've created a table to capture a list of Top 30 singles and forms to capture new entries. The final step is a form (unbound)...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.