| |

VerySource

 Forgot password?
 Register
Search
View: 790|Reply: 3

RadioButtonList control problem

[Copy link]

1

Threads

1

Posts

2.00

Credits

Newbie

Rank: 1

Credits
2.00

 China

Post time: 2020-3-9 15:30:02
| Show all posts |Read mode
When making a RadioButtonList control, when the AUTOPOSTBACK property is set to true, the selection returns to the default value.
  Data binding
RadioButtonList1.DataSource = DS.Tables [0] .DefaultView;
RadioButtonList1.DataTextField = "drug name"; RadioButtonList1.DataValueField = "drug name";
RadioButtonList1.DataBind ();
When ready to output to lable5 after selection
this.Label5.Text = RadioButtonList1.SelectedItem.Value;
Display error Object reference is not set to an instance of the object.
Reply

Use magic Report

0

Threads

1

Posts

2.00

Credits

Newbie

Rank: 1

Credits
2.00

 China

Post time: 2020-8-6 17:15:01
| Show all posts
I also encountered this problem, I hope the master can solve it, I am a novice
Reply

Use magic Report

1

Threads

18

Posts

15.00

Credits

Newbie

Rank: 1

Credits
15.00

 China

Post time: 2020-8-6 17:30:01
| Show all posts
Where are the binding events written?
! IsPostBack()
Reply

Use magic Report

0

Threads

58

Posts

32.00

Credits

Newbie

Rank: 1

Credits
32.00

 China

Post time: 2020-8-6 17:45:01
| Show all posts
The binding is written in
if(!IsPostBack)
{
  bind your radiobuttonlist;
}
Reply

Use magic Report

You have to log in before you can reply Login | Register

Points Rules

Contact us|Archive|Mobile|CopyRight © 2008-2023|verysource.com ( 京ICP备17048824号-1 )

Quick Reply To Top Return to the list