如何在asp.net中的java脚本函数中调用业务层方法? [英] How to call business layer method in java script function in asp.net ?

查看:60
本文介绍了如何在asp.net中的java脚本函数中调用业务层方法?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

亲爱的,



我遇到一个问题,就是调用放在业务层类中的加密方法,我必须在java脚本函数中调用此方法。 java脚本函数用于打开带有查询字符串参数的rad窗口,服务器端函数将为我们提供在rad窗口中打开的页面的参数值,所以请尽快帮助我....... .thanks

Dear all,

i am facing a problem to call a encryption method that is placed in business layer class and i have to call this method in java script function. java script function is used to open rad window with query string parameter and server side function will provide us the parameter value which to be pass for page that would open in rad window so please help me as soon as possible........thanks

推荐答案

我相信你有一个基本的问题,就是要了解在服务器上执行什么代码以及在客户端执行什么代码会发生什么。

如果您尝试使用javascript加密某些内容并且希望使用服务器端代码来实现此目的,那么您将通过互联网将原始的未加密数据发送回您的站点以启动加密。这样做的方法是在服务器上使用对WebMethod的ajax调用,该调用充当业务层对象的包装器。

我强烈建议你不要这样做!如果您将敏感信息从页面传递到服务器,则更好的解决方案是为站点的该部分实施SSL。
I believe you are having a fundamental issue understanding what happens on what code is executed on the server and what code is executed on the client.
If you are attempting to encrypt something using javascript and you want to use server side code to achieve this, you are going to be sending the raw, unencrypted data over the internet back to your site to initiate the encryption. The way you would do this is using an ajax call to a WebMethod on your server which acts as a wrapper to the business layer object.
I would highly suggest that you DO NOT DO IT LIKE THIS! If you have sensitive information being passed from the page to the server then your better solution would be to implement SSL for that portion of the site.


您好,



你可以做一件事,请在你的javascript函数调用之前调用那个业务层方法,然后将它放在hiddenfield中,然后使用hiddenfield'的值作为参数值。



谢谢!
Hi,

You can do one thing please call that business layer method before your javascript function call and put that in hiddenfield and after that use hiddenfield''s value as the parameter value.

Thanks!


这篇关于如何在asp.net中的java脚本函数中调用业务层方法?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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