开发者

Retrieve value from attribute in HTML tag in asp.NET

I have a large string containing a custom HTML tag (xxx). The tag also has two attributes.

How would I retrieve the value of the two attributes and then place the tag and its content with a new string derived from th开发者_运维问答ose two attributes?

Thanks for your time.


Where do you want to retrieve it? In the code behind?

If your tag is runat="server", you can do:

mytag.Attributes["nameofmyattribute"]


If its in string then you should consider using HTML Agility Pack. However it may be overkill so show us some sample string... maybe only some RegEx can do it.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜