覆盖__dopostback方法 [英] override __dopostback method

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

问题描述

Hello Mentors,



有人能告诉我如何使用__dopostback方法调用另一页的代码隐藏。



我想覆盖__dopostback,以便我可以更改theform的值并将其设置为我想要调用_postback的表单。



这就是asp.net自动执行的操作---



Hello Mentors,

Could anybody tell me how can i use __dopostback method to call the codebehind of another page.

I want to override the __dopostback so that i could change the value of theform and set it equal to the form for which i want to call the _postback.

this is what asp.net does automatically---

var theForm = document.forms['Form1'];
if (!theForm) {
    theForm = document.Form1;
}
function __doPostBack(eventTarget, eventArgument) {
    if (!theForm.onsubmit || (theForm.onsubmit() != false)) {
        theForm.__EVENTTARGET.value = eventTarget;
        theForm.__EVENTARGUMENT.value = eventArgument;
        theForm.submit();
    }
}







i想设置theForm = window.parent .self.firstGrid.document.Form1;





因为我想调用Form1后面的代码,这是另一个aspx。




i want to set the theForm =window.parent.self.firstGrid.document.Form1;


as i want to call the code behind of Form1 which is another aspx.

推荐答案

全部谢谢,



现在工作正常。





Thanks All,

Its working fine now.


default__doPostBack = __doPostBack;

   var theForm = window.parent.self.firstGrid.document.Form1;


这篇关于覆盖__dopostback方法的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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