开发者

Usercontrol and Page Postback

开发者 https://www.devze.com 2023-03-27 00:00 出处:网络
I have a page with three radio buttons and a calendar usercontrol. The radio buttons have autopostback and depending on which one you click it should change the calendar availabilities based on the se

I have a page with three radio buttons and a calendar usercontrol. The radio buttons have autopostback and depending on which one you click it should change the calendar availabilities based on the sel开发者_高级运维ected index. The problem is that the page load of the calendar is executing first before the selected index change (where I am setting the needed id).

Any suggestions?


You shouldn't initialize your Calendar-Control automatically in Page_Load. It should only be initialized through a public method. You could call this method If Not Page.IsPostback with default-settings and from your SelectedIndexChanged event-handler with the selected value(s) as parameter(s).

0

精彩评论

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