如何打开页面,然后调用母版页中的功能(JQUERY) [英] How can I open a page, then call a function in Master Page (JQUERY)
本文介绍了如何打开页面,然后调用母版页中的功能(JQUERY)的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
以下是我的代码,我是初学者..但希望我能很好地向您展示我的问题,任何人请帮助,提前谢谢。
Below is my code, im a beginner.. but hope I could show you nicely about my problem, anyone pls help, thanks in advance.
*******Page 2
<asp:LinkButton ID="LinkData" runat="server" > Data << Start here
代码背后
Code Behind
protected void Page_Load(object sender, EventArgs e)
{
LinkData.Attributes.Add('onClick', 'javascript:ClickData();return false;');
}
*****母版页
*****Master Page
<script>
function ClickData() {
window.location.href=('Page1.aspx');
ShowData2(); ???????????
}
</script>
<script>
function ShowData2() {
var Panel = document.getElementById("divData1")
if (Panel.style.display == "none" || Panel.style.display == "") {
Panel.style.display = "block";
document.getElementById("DataGraph").style.display = "none";
}
else {
Panel.style.display = "none";
document.getElementById("DataGraph").style.display = "block";
}
}
</script>,
推荐答案
window.location.href=('Page1.aspx');
此行之后,页面被重定向到 Page1.aspx的
。所以,之后什么都不会执行。
而是尝试在 Page1.aspx
页面加载。
After this line, page is redirected to Page1.aspx
. So, nothing will get executed after that.
Instead try to executed the code you want in the Page1.aspx
page load.
这篇关于如何打开页面,然后调用母版页中的功能(JQUERY)的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文