设计器窗格中的自定义Web控件问题(简单示例) [英] Custom web control problems in the designer pane (simple examples)

查看:45
本文介绍了设计器窗格中的自定义Web控件问题(简单示例)的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个自定义控件,可以在页面中的某些内容周围构建我们称为Formlets

的内容。这些基本上是内容包装器

部分,这些部分是带有彩色标题的表格,并提供了一个带有DIV的开放TD,用于此小平台的内容。 (DIV是

,用于DHTML隐藏和显示内容)


我创建了一个网页,逐步显示我遇到的两个问题'$

遇到了。这个问题比

解释要容易得多。


此页面以至少1280x1024分辨率最佳浏览。
< a rel =nofollowhref =http://www.cox-internet.com/wizndaly/gg/designer.htmtarget =_ blank> http://www.cox-internet.com/wizndaly/gg /designer.htm

这里是我的两个问题的总结:


1)如果我使用属性窗口更改任何属性

设计窗格,我切换回HTML视图后,嵌入自定义网页

控件的所有子控件都消失了。


2)如果我在自定义网页中嵌入了简单文本以外的任何东西

控件,设计师将不会渲染它,但它会渲染

所有内容页面运行时很好。


上面的html页面将更详细地显示每个问题。

顺便说一下,我正在运行Visual适用于IE 6.0的Windows XP上的Studio 2003。


任何帮助都是grea非常感谢!


谢谢!

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!

推荐答案




我已按照您的步骤重现相同的症状。但是,正如我的

意见,这不是vs.net的问题,相反,我认为它是由

滥用自定义控件引起的。


根据您提供的代码,您创作了一个自定义控件,

导出一些属性和方法。从自定义

控件的消费者端,我们应该访问自定义控件的公共属性,而不是在控件的打开和关闭标记之间放置任何字符串,我们应该访问自定义控件的公共属性<开放标签内的
如下:


< cc2:panelProblem id =" PanelProblem1" style =" Z-INDEX:105;左:216px;

位置:绝对; TOP:168px RUNAT = QUOT;服务器" MyText =这是一个小广告>


这里,自定义控件定义了一个名为MyText的属性。要访问

属性,我们应该使用上面显示的语法。


我们在这里讨论的症状是因为IDE检测到

有滥用自定义控件然后IDE将其删除。


如果我误解了您的疑虑,请随时告诉我。


祝你好运,

Jacob Yang

微软在线合作伙伴支持

安全! - www.microsoft.com/security

发布是按原样提供的。没有保证也没有授予任何权利。

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.


Jacob,


我想在完成所有这些工作之后我就失败了解释这个自定义控件的主要目的

。下面是一些伪造的HTML,其中的生产

实现了这样的小程序控件:


< formletCtl id =" Formlet1" ; Title =" Account Entry"

< table>

< tr>

< td>帐号< / td> ;

< td>< asp:textbox ... />< / td>

< / tr>

< tr>

...等。

< / tr>

< / table>

< / formletCtl>


- 几乎没有什么可以通过文本来解决由于你已经重新创建了问题,你怎么想?

设计视图摧毁了我/我们的内容。什么时候在属性窗口中切换属性

?问题2是什么?任何想法或

补救措施?


谢谢,


Jason


***通过开发人员指南 http://www.developersdex.com 发送***

不要只是参加USENET ......获得奖励!
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!


Jacob,


我想在完成所有这些工作后,我没有解释这个自定义控件的主要目的。这里有一些伪HTML,它是什么,

" production"小块控件的实现如下:


< formletCtl id =" Formlet1" Title =" Account Entry"

< table>

< tr>

< td>帐号< / td> ;

< td>< asp:textbox ... />< / td>

< / tr>

< tr>

...等。

< / tr>

< / table>

< / formletCtl>


- 几乎没有什么可以通过文本来解决由于你已经重新创建了问题,你怎么想?

设计视图摧毁了我/我们的内容。什么属性是在属性窗口中切换
?问题2是什么?任何

的想法或补救措施?


谢谢,


Jason
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


这篇关于设计器窗格中的自定义Web控件问题(简单示例)的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆