473,320 Members | 2,112 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,320 software developers and data experts.

RadioButtonList Selection Resets On Postback

I'm having a strange problem with a RadioButtonList (manually populated
in the HTML, not data-bound) on one of my ASP .NET pages. I have the
user select a value and click a button, then the code-behind's function
for that button re-sorts a list based on the selected value. However,
every postback results in the same sorting, and the RadioButtonList on
the page always returns to the default value. Is there something else I
need to be doing here?
Regards,
David P. Donahue
dd******@ccs.neu.edu
Jan 17 '06 #1
2 3747
David,

Are you checking the IsPostBack property on your page to determine
whether or not to sort, or to initialize the page? The same instance of
your class is not always going to be used in the processing of your page, so
you can't assume the state will be saved between post backs (nor can you
assume that your page will remember the state, hence the need for the check
on whether or not it is a post back).

Hope this helps.
--
- Nicholas Paldino [.NET/C# MVP]
- mv*@spam.guard.caspershouse.com

"David P. Donahue" <dd******@ccs.neu.edu> wrote in message
news:OI**************@TK2MSFTNGP11.phx.gbl...
I'm having a strange problem with a RadioButtonList (manually populated in
the HTML, not data-bound) on one of my ASP .NET pages. I have the user
select a value and click a button, then the code-behind's function for
that button re-sorts a list based on the selected value. However, every
postback results in the same sorting, and the RadioButtonList on the page
always returns to the default value. Is there something else I need to be
doing here?
Regards,
David P. Donahue
dd******@ccs.neu.edu

Jan 17 '06 #2
> Are you checking the IsPostBack property on your page to determine
whether or not to sort, or to initialize the page?


Everything in Page_Load is wrapped in an "if (!IsPostBack){ ... }"
condition, so I should think that the function associated with clicking
the button would be the only code being executed.

I've also tried having no default selection on the RadioButtonList, but
it just returns to no selection after the postback (leaving the sorting
clause in the SQL which binds the control being sorted empty).
Regards,
David P. Donahue
dd******@ccs.neu.edu
Jan 17 '06 #3

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

3
by: William LaMartin | last post by:
If I create a RadioButtonList with, say, two items, then after the page loads and I select one of the items and then click on a button whose click event contains some code to display the...
1
by: lb | last post by:
Hello, I am trying to use a radiobuttonlist with the new multiview control. Am having trouble understanding how to build the radiobuttonlsit just one time, and not many times. In my first...
0
by: BizEd | last post by:
I have a textbox that fires an autopostback when filled in. The next field after the textbox is a RadioButtonList which I set focus to. The radiobutton list does have focus and activates when you...
5
by: =?Utf-8?B?UGF1bA==?= | last post by:
Hallo, I have a radiobuttonlist control that is added on a custom Web User Control. This control has a property that exposes the SelectedIndex property of the embedded radiobuttonlist. When...
0
by: DolphinDB | last post by:
The formulas of 101 quantitative trading alphas used by WorldQuant were presented in the paper 101 Formulaic Alphas. However, some formulas are complex, leading to challenges in calculation. Take...
0
by: DolphinDB | last post by:
Tired of spending countless mintues downsampling your data? Look no further! In this article, you’ll learn how to efficiently downsample 6.48 billion high-frequency records to 61 million...
0
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
1
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: Vimpel783 | last post by:
Hello! Guys, I found this code on the Internet, but I need to modify it a little. It works well, the problem is this: Data is sent from only one cell, in this case B5, but it is necessary that data...
0
by: jfyes | last post by:
As a hardware engineer, after seeing that CEIWEI recently released a new tool for Modbus RTU Over TCP/UDP filtering and monitoring, I actively went to its official website to take a look. It turned...
0
by: ArrayDB | last post by:
The error message I've encountered is; ERROR:root:Error generating model response: exception: access violation writing 0x0000000000005140, which seems to be indicative of an access violation...
0
by: af34tf | last post by:
Hi Guys, I have a domain whose name is BytesLimited.com, and I want to sell it. Does anyone know about platforms that allow me to list my domain in auction for free. Thank you
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.