观看设计时间后没有坚持控制? [英] not persisting control after viewing design time?
问题描述
我有一个自定义服务器Web控件,它在一个模板化的子控件中插入另一个自定义Web服务器
控件(一个在其后面插入一个头文件的内容)
现在切换到设计视图后,将标题插入到
aspx页面的xml中。我不想要这个,因为当我再次切换到设计视图时又插入另一个标题
。
我试过查看你可以设置的属性在一个组件上,但是我没有找到任何可以阻止整个组件序列化的东西,只有一个
的属性或事件。
如何阻止设计视图实际将标题插入到向导步骤模板的
xml中?
亲切的问候,>
Allan Ebdrup
I have a custom server web control that inserts another custom web server
control in a templated child control (a wisard that inserts a header in its
wizardstep)
Now after switching to design view and back the header is inserted in the
aspx page''s xml. I don''t want this because then yet another header is
inserted when I switch to design view again.
I''ve tried looking through the attributes you can set on a component but I
can''t find anything that stops serialization of an entire component, only a
property or event.
How can I stop the design view from actually inserting the header into the
xml of the wizard step template?
Kind Regards,
Allan Ebdrup
推荐答案
嗨Allan,
我不确定是否我完全理解你的问题。什么样的标题在
的WizardStep?
如果这是你在另一篇文章中提到的同一个控件,我想我是
$ b在您向我发送可重复的项目后,$ b也可以帮助您。谢谢。
问候,
Walter Wang(wa****@online.microsoft.com,删除''在线。'')
Microsoft在线社区支持
================================= =================
在回复帖子时,请回复群组通过你的新闻阅读器
其他人可以从你的问题中学习并从中受益。
==================== ==============================
此帖子提供按现状 ;没有保证,也没有授予任何权利。
Hi Allan,
I''m not sure if I fully understand your question. What kind of header in
the WizardStep?
If this is the same control you mentioned in your another post, I think I
can also help you after you send me a reproducible project. Thanks.
Regards,
Walter Wang (wa****@online.microsoft.com, remove ''online.'')
Microsoft Online Community Support
==================================================
When responding to posts, please "Reply to Group" via your newsreader so
that others may learn and benefit from your issue.
==================================================
This posting is provided "AS IS" with no warranties, and confers no rights.
" Walter Wang [MSFT]" < wa **** @ online.microsoft.com写信息
新闻:iK ************** @ TK2MSFTNGHUB02.phx.gbl ...
"Walter Wang [MSFT]" <wa****@online.microsoft.comwrote in message
news:iK**************@TK2MSFTNGHUB02.phx.gbl...
嗨Allan,
我不确定我是否完全理解你的问题。什么样的标题在
的WizardStep?
如果这是你在另一篇文章中提到的同一个控件,我想我是
$ b在您向我发送可重复的项目后,$ b也可以帮助您。谢谢。
Hi Allan,
I''m not sure if I fully understand your question. What kind of header in
the WizardStep?
If this is the same control you mentioned in your another post, I think I
can also help you after you send me a reproducible project. Thanks.
标题是我自己的web服务器用户控件
我找到了一个解决方案,而不是将标题添加到所有的向导中/>
在向导的HeaderContainer中添加标题:
------
protected override void OnInit(EventArgs e)
{
if(ShowCustomHeader)
{
this.HeaderText ="英寸; //我们需要这个来渲染标题。
控制wizardHeader = this.FindControl(" HeaderContainer")作为Control;
if(wizardHeader!= null)
{
CustomWizardStepHeader header = new CustomWizardStepHeader();
header.CustomWizard = this;
header.ID =" CustomWizardStepHeader" ;;
wizardHeader.Controls.AddAt(0,header);
}
}
base。 OnInit(e);
}
------
它没有出现在设计视图中,但我想我可以忍受......
亲切的问候,
Allan Ebdrup
使用AJAX进行免费调查(测试版): http://obsurvey.com
嗨Allan,
向导继承自CompositeControl。我们通常在CreateChildControls方法中创建
a复合控件的子控件。
我建议你覆盖CreateChildControls,首先调用
base.CreateChildControls,然后添加自定义标题。这将使
也出现在设计师手中。
问候,
Walter Wang(wa****@online.microsoft.com ,删除''在线。'')
Microsoft在线社区支持
================= =================================
在回复帖子时,请回复分组通过你的新闻阅读器
其他人可以从你的问题中学习并从中受益。
==================== ==============================
此帖子提供按现状 ;没有保证,也没有授予任何权利。
Hi Allan,
Wizard inherits from CompositeControl. We normally create child controls of
a composite control in the method CreateChildControls.
I suggest you to override CreateChildControls, call
base.CreateChildControls first, then add your custom header. This will make
it also appear in the designer.
Regards,
Walter Wang (wa****@online.microsoft.com, remove ''online.'')
Microsoft Online Community Support
==================================================
When responding to posts, please "Reply to Group" via your newsreader so
that others may learn and benefit from your issue.
==================================================
This posting is provided "AS IS" with no warranties, and confers no rights.
这篇关于观看设计时间后没有坚持控制?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!