开发者

asp.net session in usercontrol empty until page refresh

开发者 https://www.devze.com 2023-01-18 03:13 出处:网络
I\'m creating some sort of \"wishlist\" where users can click on any item in a repeater (clicking on a button).

I'm creating some sort of "wishlist" where users can click on any item in a repeater (clicking on a button).

When a users clicks the button I add that item to a session("wishlist"). Th开发者_运维技巧e session contains a list of strings that are shown in a wishlist.

To render the wishlist on several pages I'm using a user control that contains a repeater that just loops over all items in that same session variable.

This works great, except for when I click on an item button "add to list" in the repeater, the user control does not show this newly added item in the wishlist (repeater looping over the session) until I manually refresh the page.

The button "add to list" in the repeater is triggerting a postback so I would think that the user control is being rendered again from the ground up.

Any ideas what's wrong?

0

精彩评论

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