简体   繁体   English

用JavaScript调用另一个框架ASP.NET C#函数

[英]calling another frame ASP.NET C# function with javascript

in my MainFrame.aspx i have create the panel with load ajaxFrm.aspx 在我的MainFrame.aspx中,我已经创建了带有加载ajaxFrm.aspx的面板

<ext:Panel ID="pnlAjax" runat="server" Height="30" Title="" Header="false" Frame="true">  
<AutoLoad Url="ajaxFrm.aspx" Mode="IFrame" ShowMask="false" />  
</ext:Panel>  

i the ajaxFrm.aspx having this C# LoadVehStore2 Function 我具有此C# LoadVehStore2函数的LoadVehStore2

function LoadVehStore2() {

}

in MainFrame.aspx i have a javascript when the page are load then run the javascript 在MainFrame.aspx中,当页面加载时我有一个javascript,然后运行javascript

frmAjax = parent.frames["pnlAjax"];
frmAjax.LoadVehStore2();

this thing can work proper in IIS, 这个东西可以在IIS中正常工作,
but in Ubuntu Mono 3.3.0 are fail, why? 但是在Ubuntu Mono 3.3.0中失败了,为什么? how to solve this? 如何解决呢?

That's not C#. 那不是C#。 It's Javascript. 它是Javascript。 I doubt that the problem is with Mono, I suspect the problem is with the browser. 我怀疑问题出在Mono,我怀疑问题出在浏览器。

Since the iframe is created by Ext.Net you have to reference it with the name Ext.Net gives to it. 由于iframe是由Ext.Net创建的,因此必须使用Ext.Net为其赋予的名称进行引用。 To get the name just use the developer tools of the browser, but it should be pnlAjax_IFrame . 要获得名称,只需使用浏览器的开发人员工具,但它应该是pnlAjax_IFrame Or, if it's the only iframe in the parent page you'd better reference it by id: 或者,如果它是父页面中唯一的iframe,则最好通过id进行引用:

frmAjax = parent.frames[0].LoadVehStore2();

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM