Object Reference Error

2 posts, 0 answers
  1. Shamim
    Shamim avatar
    10 posts
    Member since:
    Jul 2010

    Posted 20 Sep 2010 Link to this post

    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. 
  2. Pavlina
    Admin
    Pavlina avatar
    6187 posts

    Posted 23 Sep 2010 Link to this post

    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
Back to Top