Ask a Question related to ASP.NET General, Design and Development.
-
KathyB #1
radio button list doesn't hold value?
Hi. I have a radio button list with list items assigned via a
datareader from a database. Everything looks fine, the items are there
on page load, I can click one, etc. There is also a required validator
on the list.
However, when I hit SUBMIT, the selection disappears so the first line
of my submit click code (If Page.IsValid = True Then)...is always
"false" and nothing happens of course.
I'm probably just tired of staring at it, but how does this happen?
Thanks again. Kathy
KathyB Guest
-
Radio Button & List to search - ASP
Hi Guys, Can someone point me to a tutorial for DW 8 or advise me on how to do this. I want to search a database using 2 radio buttons and a... -
How to put a full radio button list in each row of datagrid?
Hello, I have a datagrid where I display images. I want visitors to be able to rate the images on a scale of 1 to 10 by clicking a radio button,... -
how to make columns the same size in a radio button list
The only thing i can figure out is making the length of the Text property on each listitem the same. That means something like this: ... -
Programmatically Selecting Item in Radio Button List
I have created a radio button list programmatically. C# SqlConnection conn = new SqlConnection("data source=localhost; integrated security=true;... -
Radio Button List server control and java script
How can i check in java script if a asp.net radio button list server control is selected? I have some custom javascript function in the client... -
John Saunders #2
Re: radio button list doesn't hold value?
"KathyB" <KathyBurke40@attbi.com> wrote in message
news:75e8d381.0308111653.8a997ef@posting.google.co m...Kathy,> Hi. I have a radio button list with list items assigned via a
> datareader from a database. Everything looks fine, the items are there
> on page load, I can click one, etc. There is also a required validator
> on the list.
>
> However, when I hit SUBMIT, the selection disappears so the first line
> of my submit click code (If Page.IsValid = True Then)...is always
> "false" and nothing happens of course.
>
> I'm probably just tired of staring at it, but how does this happen?
>
As an experiment, try removing the RequiredFieldValidator, then, on
PostBack, check to see if you can change RadioButtonList.SelectedItem. I'd
also suggest turning on page tracing and look to see what gets posted back
for the RadioButtonList.
--
John Saunders
Internet Engineer
[email]john.saunders@surfcontrol.com[/email]
John Saunders Guest
-
Craig Deelsnyder #3
Re: radio button list doesn't hold value?
Make sure you're using the check for IsPostBack in your Page_Load as
appropriate. You don't want to rebind your button list datasource
everytime, it should be in a check:
If Not IsPostBack Then
'create datasource/bind to list
End If
in Page_Load. As well as any other setup that is only to be run once....
--
Craig Deelsnyder
Microsoft MVP - ASP/ASP.NET
"KathyB" <KathyBurke40@attbi.com> wrote in message
news:75e8d381.0308111653.8a997ef@posting.google.co m...> Hi. I have a radio button list with list items assigned via a
> datareader from a database. Everything looks fine, the items are there
> on page load, I can click one, etc. There is also a required validator
> on the list.
>
> However, when I hit SUBMIT, the selection disappears so the first line
> of my submit click code (If Page.IsValid = True Then)...is always
> "false" and nothing happens of course.
>
> I'm probably just tired of staring at it, but how does this happen?
>
> Thanks again. Kathy
Craig Deelsnyder Guest



Reply With Quote

