javascript和弹出窗口的.postback问题 [英] .postback problem with javascript and popups

查看:47
本文介绍了javascript和弹出窗口的.postback问题的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我编写的代码可以正常运行单个页面,当链接按钮悬停在它上面会导致javascript代码从文档准备就绪,导致弹出窗口显示。

但是当另一个链接按钮时单击,导致回发,然后执行C#linkbutton_click函数,javascript函数不再触发!



I wrote code that works correctly for a single page, when a linkbutton is hovered over it causes javascript code to execute from a document ready, that causes a popup to show.
BUT when another linkbutton is clicked, causing a postback and then a C#linkbutton_click function to execute, the javascript functions no longer triggers!

<script type="text/javascript">
  $(document).ready(function (e) {....
     $(''.cssclassname'').hover(function (e) {
       call webservice here
       cause popup to show
     )};
});
</script>

in C# codebehind:
pageload()[
...set display of page and add original set of LinkButtons(added programatically)
}
        protected void LinkButton1_Click(object sender, EventArgs e)
        {
           //get Calenday Month and year and set Calendar title with month and year

            //add new set of linkbuttons to page that should cause popups when hovered over
                (built programatically)

            //set popup data for balloon and picture

        }

<当链接按钮悬停时,你可以看到显示在浏览器左下角的
中的javascript函数调用,但是没有弹出窗口,但是没有


或者实际执行javascript发生了

在LinkBut​​ton1_Click执行后!



如何解决这个问题或者我该如何排除故障?



注意:使用



when the linkbutton is hovered over, you can see the javascript function call displayed in
the lower left corner of the browser, but no popup or actual execution of javascript occurs
after LinkButton1_Click has executed!

how can this be fixed or how can i troubleshoot?

NOTE: using

var prm = Sys.WebForms.PageRequestManager.getInstance();
    prm.add_pageLoaded(PageLoadedEventHandler);
    function PageLoadedEventHandler() {<pre><pre lang="c#">



INSTEAD文件准备就绪,javascript现在''触发'',但是ajax仍然没有'''请致电

网络服务!


INSTEAD of document ready, the javascript now ''fires'', but ajax still doesn''t call
web service!

推荐答案

(文件).ready(function(e){....
(document).ready(function (e) {....


(''。cssclassname'')。hover(function(e){
call webservice here
导致popup显示
)};
}) ;
< / script> C#中的

代码隐藏:
pageload()[
...设置页面显示并添加原始的LinkBut​​tons集(以编程方式添加)
}
protected void LinkBut​​ton1_Click(object sender,EventArgs e)
{
//获取日历月和年并设置日历标题包含月份和年份

//添加新的链接按钮集到在
上悬停时应该导致弹出窗口的页面(以编程方式构建)

//设置气球和图片的弹出数据

}
(''.cssclassname'').hover(function (e) { call webservice here cause popup to show )}; }); </script> in C# codebehind: pageload()[ ...set display of page and add original set of LinkButtons(added programatically) } protected void LinkButton1_Click(object sender, EventArgs e) { //get Calenday Month and year and set Calendar title with month and year //add new set of linkbuttons to page that should cause popups when hovered over (built programatically) //set popup data for balloon and picture }

<当链接按钮悬停时,你可以看到显示在浏览器左下角的
中的javascript函数调用,但是没有弹出窗口,但是没有


或者实际执行javascript发生了

在LinkBut​​ton1_Click执行后!



如何解决这个问题或者我该如何排除故障?



注意:使用



when the linkbutton is hovered over, you can see the javascript function call displayed in
the lower left corner of the browser, but no popup or actual execution of javascript occurs
after LinkButton1_Click has executed!

how can this be fixed or how can i troubleshoot?

NOTE: using

var prm = Sys.WebForms.PageRequestManager.getInstance();
    prm.add_pageLoaded(PageLoadedEventHandler);
    function PageLoadedEventHandler() {<pre><pre lang="c#">



INSTEAD文件准备就绪,javascript现在''触发'',但是ajax仍然没有'''请致电

网络服务!


INSTEAD of document ready, the javascript now ''fires'', but ajax still doesn''t call
web service!


您粘贴的代码存在语法问题。
Code which you pasted haveing syntax issue.


这篇关于javascript和弹出窗口的.postback问题的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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