FINDING CONTROL ON ASPX

Ankita Pandey

Total Post:183

Points:1285
Posted by  Ankita Pandey
 900  View(s)
Ratings:
Rate this:

I have a aspx page which has a few radcomboboxes; radTerm and radOldYear.

aspx also has a radgrid which is updatable by a WebUserControl ascx. This Web user control has a few radcomboboxes, radName and radNewyr.

In the .ascx.cs, i want to be able to find the comoboxes which are on the promote.aspx. Tried using:

RadComboBox tl = (RadComboBox)this.Page.FindControl("radTerm");

Someone please help me find the controls on the main page. i am calling them through the webuser control that i load in the radgrid.

  1. Sumit Kesarwani

    Post:378

    Points:2694
    Re: Finding control on aspx

    Hi Ankita, 


    First, you have to find the promote.ascx control on the page, so:

    Control promote = (Control)this.Page.FindControl("WhateverYouCalledPromote");

    Now that you have found the control, you can search for the control that you want:

    RadComboBox tl = (RadComboBox)promote.FindControl("radTerm");

Answer

NEWSLETTER

Enter your email address here always to be updated. We promise not to spam!