如何通过javascript更新隐藏的字段值代码 [英] How to get hidden field value code behind updated by javascript

查看:122
本文介绍了如何通过javascript更新隐藏的字段值代码的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个< ASP:菜单/>控制和隐藏的字段。现在我使用jquery来改变隐藏字段的值。代码是: -

I have an < asp:menu/> control and a hidden field.Now i am using jquery to change value of hidden field. Code is:-

$(function() {

    $(".primaryStaticMenu  tr,td").each(function(index) {

        $(this).click(function() {

            if ($(this).attr("title") != "undefined"
                && $(this).attr("title").length > 0) {

                document.getElementById('ctl00_Hidden_Master_Location').value = $(this).attr("title");

                alert(document.getElementById('ctl00_Hidden_Master_Location').value);
                //return false;
            }
        });
    });
});





获取更新值的服务器端代码为: -



Server side code to get updated value is:-

String Get_cng_value = Hidden_Master_Location.Value;



但是Hidden_​​Master_Location.Value每次都显示为null。任何人都可以告诉我如何获取隐藏字段代码的更新值。


But Hidden_Master_Location.Value shows null every time. can any one tell me how to get updated value of hidden field code behind.

推荐答案

(function(){
(function() {


.primaryStaticMenu tr,td)。each(function(index){
(".primaryStaticMenu tr,td").each(function(index) {


this )。click(function(){

if
(this).click(function() { if (


这篇关于如何通过javascript更新隐藏的字段值代码的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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