This is a migrated thread and some comments may be shown as answers.

Object Reference Error

1 Answer 15 Views
Ajax
This is a migrated thread and some comments may be shown as answers.
Shamim
Top achievements
Rank 1
Shamim asked on 21 Sep 2010, 12:08 AM
I am a user control that has a radio button and I am trying to ajaxyfy the radio button from the main aspx page. The code is as followed:

Control MyControl = (Control)Page.FindControl("WebUserControl1");

RadioButton MyButton = (RadioButton)MyControl.FindControl("rdbFirstOne");
Label MyLabel = (Label)MyControl.FindControl(
"Label1");

RadAjaxManagerProxy1.AjaxSettings.AddAjaxSetting(MyButton, MyLabel, null);

When I debug this, I get object reference error on "RadioButton MyButton = (RadioButton)MyControl.FindControl("rdbFirstOne");
"
line.


Please help. Thanks. 

1 Answer, 1 is accepted

Sort by
0
Pavlina
Telerik team
answered on 23 Sep 2010, 01:55 PM
Hello Shamim,

The provided code looks correct.  Could you please elaborate on which event are you adding the Ajax settings? Also you can try to initiate ajax request explicitly from the WebUserControl by using  RadAjaxManager.GetCurrent() method call and see if the issue still persists. More information on this implementation could be find here.

Kind regards,
Pavlina
the Telerik team
Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items
Tags
Ajax
Asked by
Shamim
Top achievements
Rank 1
Answers by
Pavlina
Telerik team
Share this question
or