I create an HtmlGenericControl as follows:
HtmlGenericControl
HtmlGenericControl inner_li = new HtmlGenericControl("li"); inner_li.Attributes.Add("style", "list-style-type: none");
How can I get the value of this attribute ( style ).
style
You can do this with an indexer:
var style = inner_li.Attributes["style"];
Just note: when working with styles, it is better to use the HtmlControl.Style property:
HtmlControl.Style
inner_li.Style[HtmlTextWriterStyle.ListStyleType] = "none";
The Attributes property is the collection of value values. That way you can do string tempstr = inner_li.Attributes["style"] .
string tempstr = inner_li.Attributes["style"]
See msdn doc .
You can get the value using the following statement
string myvalue= inner_li.Attributes["style"];
Source: https://habr.com/ru/post/1398973/More articles:Jsf: what is the bean area for a two page page? - scopeThe main graph disables y-axis scaling, scrolling - objective-cExtract url of previous page in html? - htmlHow to get the current stack level - stackCheck switch with ExtJS - javascriptRetrieving all subject attribute values ββin a certificate - c ++Why is node.js memory leak when restarting redis - node.jsHow to find the previous month in vb6 or in vba? - vbajQuery - use an existing handler for new elements - jqueryCheck the default values ββand Mojos expressions with Maven Plugin Testing Harness: - mavenAll Articles