473,670 Members | 2,298 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

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.ne u.edu
Jan 17 '06 #1
2 3767
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.co m

"David P. Donahue" <dd******@ccs.n eu.edu> wrote in message
news:OI******** ******@TK2MSFTN GP11.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.ne u.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.ne u.edu
Jan 17 '06 #3

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

Similar topics

3
8997
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 RadioButtonlList's selected value, there is nothing. On a postback, with the dynamically created button list visible on the page and the first item selected, if I try some code like "If Me.RadioButtonList1.Items(0).Selected = True Then.......", then I...
1
1395
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 view, I select from a list of items, then select "next". Of course, this causes a postback, and displays the next view. On this second view, I want to build a radiobuttonlist based on the
0
1780
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 hit the spacebar, but the little selection box does not appear around the first item like it does when you tab to a radiobutton list. So in essence, the user has no idea where they are on the screen. I've tried both the focus() method and...
5
2685
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 running this in IE, behaviour is as I would expect it. If I select an item and do a postback, the page remembers my selection when reloading, and the SelectedIndex property of my control returns the correct value.
0
8469
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
8386
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
8814
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
0
7419
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
1
6213
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
5684
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
4391
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
2800
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
2
1794
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

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.