在asp.net的java脚本中发送文件名表单客户端 [英] send file name form client side in java script for asp.net

查看:45
本文介绍了在asp.net的java脚本中发送文件名表单客户端的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

hi
i放在页面jquery库中,点击图片后想要运行该方法本身已实现但我无法访问当前图片名称,这只是运行服务器中的第一个图片方法。

如何访问asp.net(服务器端)中的当前pic名称或通过java将服务器名称发送到服务器

tnx

hi i put in page jquery gallery,a want when clicked on picture then run The method itself is implemented but i can''t access to the current picture name and this just run the first picture method in server .
how access to current pic name in asp.net(server side) or send pic name by java to server
tnx

推荐答案

简单的解决方案是在javascript绑定中有一个asp隐藏字段控件,该隐藏字段的可变值。这就是现在你可以在服务器端获得隐藏的字段值。检查下面的示例代码,将javascript变量设置为asp隐藏字段。



Simple solution would be have an "asp hidden field" control in javascript bind that varaible value to that hidden field. thats it now you can get the hidden field value in server side. check the below sample code for setting the javascript variable to asp hidden field.

var hfObj = document.getElementById('<%=HiddenfieldId.ClientID%>');
hfObj.value = "the value you want to assign";





在服务器端像往常一样



in server side like the usual way

string someVar = HiddenfieldId.value;





是你需要这个吗?



Is this what you required?


这篇关于在asp.net的java脚本中发送文件名表单客户端的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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