在ajax调用c#代码后丢失隐藏的字段值 [英] loosing hidden field value after ajax call to c# code
本文介绍了在ajax调用c#代码后丢失隐藏的字段值的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
Hii,
Hii ,
var ordervalue = $("#" + '<%= hdnSort.ClientID %>').val();
if (ordervalue == '') {
$("#" + '<%= hdnSort.ClientID %>').val('asec');
$.ajax({
type: "POST",
url: "DevelopmentReport.aspx/SortingCall",
data: null,
//dataType: "json",
async: true,
cache: false,
// success: function () {
// $("#" + '<%= hdnSort.ClientID %>').val('asec');
//}
})
}
这是我的函数,在onclientclik上调用,服务器端webmethods被调用..
但是在这里暗示里面隐藏的价值,当我试图检查我的webmethiod,hdnSort的价值时会有损失。
请建议
this is my function , which gets called on onclientclik , and server side webmethods gets invoked ..
but the value mentaining inside hiddenfield here , gets lossted when i try to check in my webmethiod ,the value of hdnSort.
Please suggest
推荐答案
( # + ' <%= hdnSort.ClientID%>')。val();
if (ordervalue == ' '){
("#" + '<%= hdnSort.ClientID %>').val(); if (ordervalue == '') {
( # + < span class =code-string>' <%= hdnSort.ClientID%>')。val(' asec');
("#" + '<%= hdnSort.ClientID %>').val('asec');
.ajax({
type: POST,
url: DevelopmentReport.aspx / SortingCall,
data: null ,
// dataType:json,
async: true ,
cache: false ,
// success:function(){
//
.ajax({ type: "POST", url: "DevelopmentReport.aspx/SortingCall", data: null, //dataType: "json", async: true, cache: false, // success: function () { //
这篇关于在ajax调用c#代码后丢失隐藏的字段值的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文