我问一个关于ajax 里面 updatepanel的嵌套的问题!!!
我的程序里有2个updatepanel
一个在外面, 一个嵌套在里面
现在里面的updatepanel里有button,
我发现,点击里面的button,依然会刷新页面一次,但是刷了第一次后,内updatepanel里
面的button再怎么点都是无刷新了,反正每次都要刷新第一次,然后就可以无刷新了
这个是怎么回事呢??
我看了下相关资料,把内updatepanel改成了conditional ,然后指定了Triggers为某button
但是点的话还是会刷一次, 然后才能实现无刷
请教!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
[解决办法]
晕,不会刷的
[解决办法]
up
[解决办法]
没遇到过,但为什么不用一个就行了呢
而且是嵌套的,会不会就是嵌套才出现这样的问题的呢
[解决办法]
<asp:ScriptManager ID= "ScriptManager "
runat= "server " />
<asp:UpdatePanel ID= "OuterPanel "
UpdateMode= "Conditional "
runat= "server ">
<ContentTemplate>
<div>
<fieldset>
<legend> Outer Panel </legend>
<br />
<asp:Button ID= "OPButton1 "
Text= "Outer Panel Button "
runat= "server " />
<br />
Last updated on
<%= DateTime.Now.ToString() %>
<br />
<br />
<asp:UpdatePanel ID= "NestedPanel1 "
UpdateMode= "Conditional "
runat= "server ">
<ContentTemplate>
<div class= "NestedPanel ">
<fieldset>
<legend> Nested Panel 1 </legend>
<br />
Last updated on
<%= DateTime.Now.ToString() %>
<br />
<asp:Button ID= "NPButton1 "
Text= "Nested Panel 1 Button "
runat= "server " />
</fieldset>
</div>
</ContentTemplate>
</asp:UpdatePanel>
</fieldset>
</div>
</ContentTemplate>
</asp:UpdatePanel>
主要是
[解决办法]
你什么要套一个!一个就可以了.里面的内容都是刷的!如果你把里面的updatepanel内的button指定triger的话.应该会重新刷新一次.不过我没试过!你用一个看看!
[解决办法]
再发一个例子!!!
具体真的不知道LZ的意思 !
参考参考拉!
<asp:UpdatePanel ID= "UpdatePanel1 " runat= "server " UpdateMode= "Conditional ">
<ContentTemplate>
<asp:Button ID= "Button1 " runat= "server " OnClick= "Button1_Click " Text= "确定 " />
<asp:Button ID= "Button2 " runat= "server " Text= "取消 " OnClick= "Button2_Click " />
<asp:TextBox ID= "TextBox1 " runat= "server "> </asp:TextBox>
<asp:Label runat= "server " ID= "InputTimeLabel "> <%=DateTime.Now %> </asp:Label>
</ContentTemplate>
</asp:UpdatePanel>
<asp:UpdatePanel ID= "UpdatePanel2 " runat= "server " UpdateMode= "Conditional ">
<ContentTemplate>
<asp:TextBox ID= "TextBox2 " runat= "server "> </asp:TextBox>
<asp:Label runat= "server " ID= "Label1 "> <%=DateTime.Now %> </asp:Label>
</ContentTemplate>
<Triggers>
<asp:AsyncPostBackTrigger ControlID= "Button1 " />
</Triggers>
</asp:UpdatePanel>
[解决办法]
不会刷啊