Home > DeveloperSection > Forums > Finding control on aspx
Ankita Pandey
Ankita Pandey

Total Post:183

Points:1285
Posted on    August-26-2014 2:27 AM

 ASP.Net ASP.Net 
Ratings:


 1 Reply(s)
 688  View(s)
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.



Sumit Kesarwani

Total Post:378

Points:2694
Posted on    August-26-2014 3:01 AM

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");


Don't want to miss updates? Please click the below button!

Follow MindStick