开发者

send two argument by postback

开发者 https://www.devze.com 2023-02-25 04:11 出处:网络
I use th开发者_StackOverflow中文版e __dopostback function in javascript page to send some information to the RaisepostbackEvent() method in my c# page.

I use th开发者_StackOverflow中文版e __dopostback function in javascript page to send some information to the RaisepostbackEvent() method in my c# page.

RaisepostbackEvent() method accepts just one string argument, but I want to send two string arguments.


you could join the two strings using a separator character and split them on the client.

on the server:

result = string1 + "|" + string2;

on the client:

   var strings = result.split("|"); 
   if (strings.length == 2) 
   {
     var string1 = strings[0];      
     var string2 = strings[1];
   }
0

精彩评论

暂无评论...
验证码 换一张
取 消