问题描述
大家好..
我有更新面板,例如
hi all..
i have update panel like
<asp:ScriptManager ID="ScriptManager1" runat="server" />
<asp:Timer runat="server" ID="UpdateTimer" Interval="10000" OnTick="UpdateTimer_Tick" />
<asp:UpdatePanel runat="server" ID="TimedPanel" UpdateMode="Conditional">
<Triggers>
<asp:AsyncPostBackTrigger ControlID="UpdateTimer" EventName="Tick" />
</Triggers>
<ContentTemplate>
<div id="emplist" style="position: absolute; right: -55px; color: Red; background-color: Black;
padding: 2px 14px; text-align: center; cursor: pointer; font-weight: bold;">
EMP List
</div>
<div id="emplistsh" style="position: absolute; top: 32px; right: 4px; overflow: visible;
z-index: 10000; margin-top: 5px; height: 300px;">
<asp:Panel ID="pnllist" runat="server" Height="525px" ScrollBars="Vertical">
<asp:GridView ID="gridlist" runat="server" CellPadding="0" CellSpacing="0" AutoGenerateColumns="false">
<Columns>
<asp:TemplateField ShowHeader="false">
<ItemTemplate>
<asp:Image ID="imgstatus" runat="server" ImageUrl="~/img/black.png" Width="15px"
Style="padding: 1px; padding-top: 10px;" />
<a style="removed: pointer; padding: 0px 1px 1px 1px;" target="_blank">
<%# Eval("list")%></a>
</ItemTemplate>
</asp:TemplateField>
</Columns>
</asp:GridView>
</asp:Panel>
</div>
</ContentTemplate>
</asp:UpdatePanel>
我在Google中搜索了很多东西,最后我得到了在更新面板脚本之内应用jquery效果的脚本,如
and i was search a lot in Google finally i got script for apply jquery effects inside update panel script like
function BindEvents()
{
$(document).ready(function(){ // do something }); insteed of
// $("#chatlist").hide(2000);
$("#emplist").click(function(){
$("#emplistsh").toggle(2000);
});
});
}
var prm = Sys.WebForms.PageRequestManager.getInstance();
prm.add_endRequest(BindEvents);
计时器滴答事件如下:
and timer tick event goes like:
protected void UpdateTimer_Tick(object sender, EventArgs e)
{
try
{
MySqlCommand cmd = new MySqlCommand("select e.firstname as list,replace(e.firstname,' ','') as headlist,e.empid,u.status,concat(firstname,' ',lastname) as fullname from employee e,usertable u where u.username=e.empid and e.empid!='" + Session["username"].ToString() + "' AND empstatus='0' order by firstname asc", con);
MySqlDataAdapter da = new MySqlDataAdapter(cmd);
DataSet ds = new DataSet();
da.Fill(ds, "employee");
gridlist.DataSource = ds.Tables["employee"];
gridlist.DataBind();
}
catch (Exception ex)
{
// Response.Redirect("login.aspx");
}
finally
{
if (con.State == ConnectionState.Open)
con.Close();
}
}
因为在计时器滴答事件运行后一段时间内工作良好,它恢复了原来的位置,我的意思是单击emplist之后它正在隐藏,但是在计时器滴答之后它会自动显示员工,所以我如何永久隐藏"emplistsh"(div)单击"emplist"(div)list.i已经进行了3天.有人可以帮我吗
在此先感谢...
as it is working fine for some time after timer tick event runs it is getting back to original position i mean after clicking emplist it is hiding but after timer tick it is automatically showing employee so how can i hide "emplistsh"(div) permanently up to clicking on "emplist"(div) list.i was working on this for last 3 days. can any one help me please
thanks in advance...
推荐答案
这篇关于更新面板计时器刻度事件调用时,jquery效果不起作用的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!