Profile Picture

NLabelElement with Html

Posted By Den Zavor 6 Years Ago
Author
Message
Den Zavor
Problem Posted 6 Years Ago
View Quick Profile
Forum Newbie

Forum Newbie (6 reputation)Forum Newbie (6 reputation)Forum Newbie (6 reputation)Forum Newbie (6 reputation)Forum Newbie (6 reputation)Forum Newbie (6 reputation)Forum Newbie (6 reputation)Forum Newbie (6 reputation)Forum Newbie (6 reputation)

Group: Forum Members
Last Active: 5 Years Ago
Posts: 2, Visits: 14
Hi all,
I'm using NGalleryItem with the NLabelElement. These controls are great, but I'm stick with the showing html in the Text attribute of the NLabelElement.
This control shows the html text like "<b>Name</b><br/>Id" very well, but if I try to set the value of the attribute to "<p id={1} path=\"{2}\"><b>Name: {0}</b><br />Polarity: {3}</p>" the control shows this plain text on the form rather than rendered html.
I'm using the control like this:
var item = new NGalleryItem();
item.Label.Text = string.Format("<p id={1} path=\"{2}\"><b>Name: {0}</b><br />Polarity: {3}</p>",
    Name,   // name
      Id,   // dictionary item id
      FilePath,   // rda-file path
      Polarity);

could anyone help me?
what am I doing wrong?

Nevron Support
This post has been flagged as an answer
Posted 6 Years Ago
View Quick Profile
Supreme Being

Supreme Being (4,435 reputation)Supreme Being (4,435 reputation)Supreme Being (4,435 reputation)Supreme Being (4,435 reputation)Supreme Being (4,435 reputation)Supreme Being (4,435 reputation)Supreme Being (4,435 reputation)Supreme Being (4,435 reputation)Supreme Being (4,435 reputation)

Group: Forum Members
Last Active: 2 Weeks Ago
Posts: 3,054, Visits: 4,015
Hi Den,

You need to put the value of Id attribute in quotes like in path attribute.
However, there is no sense to put such attributes in paragraph tag because the parser that is used does not recognize them.
Please, note that this is not fully functional html parser.



Best Regards,
Nevron Support Team



Den Zavor
Posted 6 Years Ago
View Quick Profile
Forum Newbie

Forum Newbie (6 reputation)Forum Newbie (6 reputation)Forum Newbie (6 reputation)Forum Newbie (6 reputation)Forum Newbie (6 reputation)Forum Newbie (6 reputation)Forum Newbie (6 reputation)Forum Newbie (6 reputation)Forum Newbie (6 reputation)

Group: Forum Members
Last Active: 5 Years Ago
Posts: 2, Visits: 14
The quotes do solve the problem!
Thank you for the quick and useful reply!
Also instead of p-tag I've used the span-tag, thank you!



Similar Topics


Reading This Topic