I am using this to transfer values from ascx codebehind to ascx user control which has 3 Labels
string text1 = fr.data[0].name;
string text2 = m.data[0].name;
string text3 = m.data[0].name;
Page.ClientScript.RegisterClientScriptBlock(this.GetType(), " ", "document.getElementById('lblfriend').innerHTML ='" + text1 + "'; return true;", true);
Page.ClientScript.RegisterClientScriptBlock(this.GetType(), " ", "document.getElementById('lblmyname').innerHTML ='" + text2 + "'; return true;", true);
Page.ClientScript.RegisterClientScriptBlock(this.GetType(), " ", "document.getElementById('lblmyname1').innerHTML ='" + text3 + "'; return true;", true);
However values aren’t getting passed and i want to render those Labels as Html so that they can be embedded in an email
Please help!
You could expose the label text as string properties in the codebehind of the UserControl. Then when you render the usercontrol, pass the values to it and it would render the text of the labels.
Codebehind for the UserControl:
Then you could load your values as such in your parent control/page: