Formatting XML Label

tyrem

New Member
With this XML file - \[code\]<Instructions> <Admin> <Instruction> Steps must be completed in order.</br> 1. Set dates</br> 2. Import.</br> 3. Generate.</br> </Instruction> <Style> <padding-left value="http://stackoverflow.com/questions/11018763/50px"/> <padding-right value="http://stackoverflow.com/questions/11018763/0px"/> </Style> </Admin></Instructions>\[/code\]And this code - \[code\] public void LoadInstructions(String instructionKey) { XmlNode instLabel = mPropsDoc.SelectSingleNode("ApplicationProperties/Instructions/Admin/Instruction"); XmlNode instStyle = mPropsDoc.SelectSingleNode("ApplicationProperties/Instructions/Admin/Style"); Label ctlInst = new Label(); ctlInst.Text = instLabel.InnerText; foreach (XmlElement styles in instStyle.ChildNodes) { ctlInst.Style.Add(styles.Name, styles.Attributes["value"].Value); } PageContent.Controls.AddAt(0, ctlInst); }\[/code\]where PageContent is a ContentPlaceHolder on my page.The style gets applied to only the first element and the control is rendered as a span control.Why isn't it being rendered as a Label and why is the style only being applied to the first line?
 
Back
Top