I want to add the server name in my page head section dynamically like
<head>
<!-- DP2-WEB005 -->
</head>
can anyone please let me know how can I add this <!-- DP2-WEB005 -->
tag in head section.
server name I will handle it but I don't know how add that commented tag dynamically.
HtmlGenericControl newControl = new HtmlGenericControl("someTag");
newControl.Attributes["someAttr"] = "some value";
Page.Header.Controls.Add(newControl);
I hope this helps ... (the reference)
UPDATE:
This is that you want :
string serverName = "QWERTY123";
this.Page.Header.Controls.Add(new LiteralControl("<!-- " + serverName + "-->"));
And here is the output :
<!DOCTYPE html>
<html xmlns="http://www.w3.org/1999/xhtml">
<head><title>
</title><!-- QWERTY123--></head>
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With