如何从ASHX处理程序文件中调用Javascript函数 [英] How to call the Javascript function from the ASHX handler file

查看:70
本文介绍了如何从ASHX处理程序文件中调用Javascript函数的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述





如何从handler.ashx文件中调用javascript函数。



i使用下面的代码调用javascript函数。但是我收到了一个错误。



ScriptManager.RegisterStartupScript(this,this.GetType(),MyMethod,MyMethod();,true );

推荐答案

你得到的错误是什么?你读过吗?



ASHX文件是一个文件处理程序,它用于返回图像等内容。因为它通常不会返回一个网页(这是aspx页面的作用),你如何期望返回javascript,你期望它去哪里?
What is the error you''re getting ? Did you read it ?

An ASHX file is a file handler, it''s used to return things like images and so on. As it does not typically return a web page ( that''s what aspx pages do ), how do you expect to return javascript, and where do you expect it to go ?


我给首先你要了解ashx

以下链接: -

http:/ /www.dotnetperls.com/ashx [ ^ ]







ASP.NET高级通用处理程序ASHX [ ^ ]





http://www.dotnetfunda.com/forums/thread672-purpose-of- handler-ashx-in-aspnet.aspx [ ^ ]





http://forums.asp.net/t/ 1796614.aspx / 1 [ ^ ]
i give suggesion to you first you know about ashx
on following links:-
http://www.dotnetperls.com/ashx[^]


also
ASP.NET Advanced Generic Handler ASHX[^]


http://www.dotnetfunda.com/forums/thread672-purpose-of-handler-ashx-in-aspnet.aspx[^]


http://forums.asp.net/t/1796614.aspx/1[^]


<form id="myForm" action="ReportHandler.ashx">

    <input type="hidden" value="" id="reportFormat"/>
</form>

-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------

    function ActionVendor() {
        var combo =


这篇关于如何从ASHX处理程序文件中调用Javascript函数的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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