6
Answers

how to find the master page's web user control in child page

hi
i have one web user control that is products.ascx i use this as a banner in my master page i want to access this user control in some other pages for this i use the following code that is

master.findControl("myControl") but , i am unable to convert this to my products because vs not show that control (like any other asp.net control) how to i solve my task.

Answers (6)
0
Koteswararao Mallisetti
NA 1.1k 468.9k 14y
Label 'idofcontrolinmasterpage'=(Label)master.findcontrol("idofcontrolinmasterpage");

for all asp.net controls it's working fine i know but my control is not behave like that asp.net control,in .cs file i unable to get it why
0
Apex Potums
NA 6 0 14y
0
jaymeen patel
NA 6 11k 14y

Label 'idofcontrolinmasterpage'=(Label)master.findcontrol("idofcontrolinmasterpage");

if you found any problem please reply
0
Krishna Garad
NA 16.5k 6.2m 14y
if your registration is ok then surely it is avail in .cs file. Is their any error on Registertag
0
Koteswararao Mallisetti
NA 1.1k 468.9k 14y
i add that one in .aspx page means
<@ Register tagName=".."> but it is not accessible in .cs file.that is the problem
0
Krishna Garad
NA 16.5k 6.2m 14y
you can add your control to visual studio then it will be avail to access