Reputation: 14774
I would like to add some paragraphs or new lines or words dynamically but I want to make gaps between every part and the other. How is it possible to do that in the c# code page?
Upvotes: 3
Views: 23909
Reputation: 21
I was able to do it using lblMessage.Text
and then replacing the "
character by the '
character in the HTML code...
lblMessage.Text = "<a href='javascript:history.go(-1)'>Go Back</a>";
Upvotes: 2
Reputation: 1767
Maybe this is the proper way: http://msdn.microsoft.com/en-us/library/620b4fzf(VS.71).aspx
So if you like to add what a paragraph with a break inside:
HtmlGenericControl paragraph = new HtmlGenericControl("p");
paragraph.Controls.Add(new HtmlGenericControl("br"));
Page.Controls.Add(paragraph );
Upvotes: 0
Reputation: 43217
You can do this using HttpModule. HttpModule can intercept request and response and modify as you need.
Upvotes: 0
Reputation: 6994
Ideally, you don't want to add markup code to your codebehind pages. But if you must, you can perhaps use HTML's <p>
element to make different paragraphs. By default, each paragraph has some top and bottom margin to separate it from other elements on the page.
Upvotes: 0
Reputation: 48098
You can use LiteralControl to add HTML tags like that :
Page.Controls.Add(new LiteralControl("<p>New<br />Line</p>"));
Upvotes: 8