Getting the object for a control on a page with a Site.Master page

EDN Admin

Well-known member
Joined
Aug 7, 2010
Messages
12,794
Location
In the Machine
Hi,
I have a page with a Master Page framing around the content.
Im trying to get the control object by the name. I dont care at this point what the type is because Ill be figuring out the type and then setting values based on the type. This is going to be a config page that will set the initial setting;
also if the setting is not set in the DB then Ill set the default for each user. Ive made a couple attempts at this in the past but it seems that the blocker for me is the fact that there is a Master Page involved. ==== this.Conrtols.Find(name,
true) doesnt work because there is no find method
Note the following code:

<pre style="background:white; color:black; font-family:Consolas <span style="color:green //IMPORTANT: Use the Control Name as the ConfigName
<span style="color:blue string[] ConfigsToCheck = { <span style="color:#a31515 "chkAudibleSCMAlarm,bool,false", <span style="color:#a31515 "TestStringConfig,text,", <span style="color:#a31515 "TestIntConfig,int,0"};
<span style="color:green //tblUserConfig -- RowId, UserName, ConfigName, ConfigType, ConfigValueText, ConfigValueInt, ConfigValueBool
<span style="color:blue foreach (<span style="color:blue var item <span style="color:blue in ConfigsToCheck)
{
<span style="color:blue string[] itemsplit = item.Split(<span style="color:#a31515 ,);
<span style="color:blue string ConfigNameAndControlName = itemsplit[0];
<span style="color:blue string ConfigType = itemsplit[1];
<span style="color:blue string ConfigDefaultValue = itemsplit[2];

<span style="color:#2b91af Control ControlToSet = [/code]


<br/>
<br/>

View the full article
 
Back
Top