整页刷新 [英] Whole Page Refreshing

查看:59
本文介绍了整页刷新的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

在这里,我正在使用asp:Update面板进行中继器控制,但是它不起作用.我的代码是
asp:UpdatePanel ID ="UpdatePanel1"; runat =服务器">
< ContentTemplate>
< asp:Panel ID =" pnlDgJobDetailsFound" runat =服务器" ScrollBars =自动";可见="false">
< asp:Repeater ID ="Repeater1" runat =服务器" OnItemCommand ="Repeater1_ItemCommand">
< HeaderTemplate>
< table border ="0" align =中心". valign ="top" cellpadding ="3" cellspacing ="1">
</HeaderTemplate>
< ItemTemplate>
< tr>
< td bgcolor =#ffffff" align =中心". valign =顶部">
< table>
< tr>
< td align ="left"宽度="320">
< a href =''<%#DataBinder.Eval(Container.DataItem,"ENGID","moreengagements.aspx?id = {0}")%>''>

< b>
<%#DataBinder.Eval(Container.DataItem,"ENGTITLE")%>
</b></a>
</td>
< td align =正确";宽度="300">
<
<%#Convert.ToDateTime(DataBinder.Eval(Container.DataItem,"PublishingDate")).ToLongDateString()%>
</td>
</tr>
< tr>
< td bgcolor =#ffffff" align ="left">
<%#DataBinder.Eval(Container.DataItem,"header")%>
. . .
</td>
</tr>
</table>
</td>
</tr>
</ItemTemplate>
< FooterTemplate>
</table>
</FooterTemplate>
</asp:Repeater>
< br/>
</asp:Panel>
</ContentTemplate>
</asp:UpdatePanel>
我面临的问题是,当我单击href时,它将导航到另一个页面,因此该页面将被回发.但是有没有其他选择可以使我的页面导航,但不应刷新.

Here I am Using asp:Update Panel for Repeater Control but it is not working. My Code is
asp:UpdatePanel ID="UpdatePanel1" runat="server">
<ContentTemplate>
<asp:Panel ID="pnlDgJobDetailsFound" runat="server" ScrollBars="Auto" Visible="false">
<asp:Repeater ID="Repeater1" runat="server" OnItemCommand="Repeater1_ItemCommand">
<HeaderTemplate>
<table border="0" align="center" valign="top" cellpadding="3" cellspacing="1">
</HeaderTemplate>
<ItemTemplate>
<tr>
<td bgcolor="#ffffff" align="center" valign="top">
<table>
<tr>
<td align="left" width="320">
<a href=''<%# DataBinder.Eval(Container.DataItem, "ENGID", "moreengagements.aspx?id={0}") %>''>

<b>
<%# DataBinder.Eval(Container.DataItem, "ENGTITLE") %>
</b></a>
</td>
<td align="right" width="300">
<
<%# Convert.ToDateTime(DataBinder.Eval(Container.DataItem, "PublishingDate")).ToLongDateString() %>
</td>
</tr>
<tr>
<td bgcolor="#ffffff" align="left">
<%# DataBinder.Eval(Container.DataItem, "header") %>
. . .
</td>
</tr>
</table>
</td>
</tr>
</ItemTemplate>
<FooterTemplate>
</table>
</FooterTemplate>
</asp:Repeater>
<br />
</asp:Panel>
</ContentTemplate>
</asp:UpdatePanel>
The Problem i am facing is when i am clicking on href it will navigate to another page so the page is getting postback. but is there any alternative that my page should navigate but it should not be refreshed.

推荐答案

实际上,当您重定向到下一页时,整个页面都会刷新.我们无法通过使用更新面板来避免这种刷新.更新面板只会在页面内提供帮助.

U将此标签添加到html标签上方,
Actually when u r redirecting to next page the full page will refresh. we cannot avoid this refresh by using update panel. update panel will help only inside the page.

U add this tag above of html tag,
<meta content="BlendTrans(Duration=0.01)" http-equiv="Page-Exit" />



好,要求是什么意思允许导航但不刷新页面?

如果要从一页导航到另一页,则整个页面都需要重新构造,因此需要完整的回发.您无法避免它,这是 the 的方式.

您可以使用更新面板仅刷新同一页面的部分内容.
Well, what does a requirement mean by allow navigate but don''t refresh page?

If you are navigating from one page to other, the whole page needs a re-construct and thus a full postback. You cannot avoid it and it is the way.

You can use update panel to refresh partial portions of the same page only.


这篇关于整页刷新的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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