占位符不起作用 [英] Placeholder not working

查看:79
本文介绍了占位符不起作用的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

大家好,



我在.aspx页面写了以下代码



< asp:PlaceHolder ID =PlaceTestrunat =server>

< asp:Timer ID =TimerTestOnTick =TimerTest_Checkrunat =serverinterval =60000>



< asp:UpdatePanel ID =updTestUpdateMode =条件runat =server>

< triggers> < asp:AsyncPostBackTrigger ControlID =TimerTestEventName =Check/> < contenttemplate>

< uc1:ctrlTest ID =ctrlTest1runat =server/>









还有相关的计时器事件也写在下面。

protected void TimerTest_Check(object sender,EventArgs e)

{

ctrlTest ctrl =(ctrlTest)LoadControl(ctrlTest.ascx);

PlaceTest.Controls.Add(ctrl);

}



目的是在每个指定的时间间隔后刷新更新面板中的控件。但我没有得到任何输出。它显示空白页。



请帮助

Hi all,

I have written following code in my .aspx page

<asp:PlaceHolder ID="PlaceTest" runat="server">
<asp:Timer ID="TimerTest" OnTick="TimerTest_Check" runat="server" interval="60000">

<asp:UpdatePanel ID="updTest" UpdateMode="Conditional" runat="server">
<triggers><asp:AsyncPostBackTrigger ControlID="TimerTest" EventName="Check" /> <contenttemplate>
<uc1:ctrlTest ID="ctrlTest1" runat="server" />




also related timer event is also written below.
protected void TimerTest_Check(object sender, EventArgs e)
{
ctrlTest ctrl = (ctrlTest)LoadControl("ctrlTest.ascx");
PlaceTest.Controls.Add(ctrl);
}

purpose is to refresh control in update panel after every specified interval. But i am not getting any output. its showing blank page.

Please Help

推荐答案





我没有看到你的代码有任何错误,



你可以尝试这个 http://msdn.microsoft.com/en-us/library/system.web.ui.timer.interval.aspx [ ^ ]



可能是占位符名称与主页不匹配
Hi,

I did not saw any errors at you code ,

you can try this http://msdn.microsoft.com/en-us/library/system.web.ui.timer.interval.aspx[^]

may be place holder name is not matched with Masterpage


这篇关于占位符不起作用的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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