开发者

List box values on postback

开发者 https://www.devze.com 2022-12-30 15:12 出处:网络
I am using asp.net mvc. I have used two list box in one of my views. I transfer desired items from left-hand-s开发者_开发技巧ide list box to right-side list box.

I am using asp.net mvc. I have used two list box in one of my views. I transfer desired items from left-hand-s开发者_开发技巧ide list box to right-side list box. On a button click, i want to get the list box contents from right side list box. I don;t get in form collection. Can anyone please suggest how can I get it?

thanks, kapil


The only values in the list box that are selected will appear in the form collection.

When you transfer to the second list box, I would add a hidden field and add the cvalues into there (with some delimiter between). Upon POST you could split the string value of this hidden value to find contents of right hand list box.

Alternatively, just prior to Submit (intercept with JavaScript), set all values in right hand list box to selected.

0

精彩评论

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