且构网

分享程序员开发的那些事...
且构网 - 分享程序员编程开发的那些事

单选按钮

更新时间:2022-10-16 22:03:19

写道:​​

我应该使用会话吗?
还是上课?
或查询字符串?
还是我可以使用简单的解决方案?



所有这些解决方案都很容易.它们都可以工作(好吧,我收回了,班级"是什么意思?).它们确实与单选按钮列表无关,但与状态管理无关.我会尽可能使用查询字符串,如果需要的话使用viewstate,如果没有选择的话使用session.根据您的要求,您知道答案,并且不提供有关您情况的详细信息,可以帮助我们告诉您要使用的是哪种情况,只是您似乎不认为使用查询字符串或会话是可行的.简单.如果您不这样认为,则应该购买一本书并阅读,因为一旦您理解了它们,就可以轻而易举地使用它们.


写道:​​

当我选择一个单选按钮时,我想转到第2页并更改背景颜色,即我在第1页中从单选按钮列表中选择的背景颜色...



确定,因此将其放在URL上.然后,您的第二页可以在任何地方设置其颜色,并且您使用的颜色可以添加书签.


hi how can i select one radio button from radio button list
and use this at another page?
i should use session?
or class?
or query string?
---------
i have 2 page,at the first page i have radio button list,with color,
when i choose one radio button i want to go to page 2 and change the background color,that i selected in page 1 from radio button list...

wrote:

i should use session?
or class?
or query string?
or i can use easy solution?



All those solutions are easy. They will all work ( well, I take it back, what do you mean by ''class'' ? ). They really have nothing to do with the radiobuttonlist, but with state management. I''d use the query string where ever possible, viewstate if I need to, and session if I have no choice. Based on what you''ve asked, you know the answers, and provide no details about your situation that help us tell you which one to use, except that it seems that you don''t think that using the query string or session are easy. If you don''t think that, you should buy a book and read it, because once you understand them, they are trivial to use.


wrote:

when i choose one radio button i want to go to page 2 and change the background color,that i selected in page 1 from radio button list...



OK, so put it on the URL. Then your second page can set it''s color from anywhere, and the color you use, is bookmarkable.