Click here to Skip to main content
15,886,783 members
Home / Discussions / ASP.NET
   

ASP.NET

 
GeneralRe: ASP.Net ActiveX control Security-warning prompt messages. Pin
alisolution19-May-09 7:42
alisolution19-May-09 7:42 
QuestionDisplay text label over image control Pin
Mohammed Elkholy18-May-09 12:59
Mohammed Elkholy18-May-09 12:59 
QuestionTree view Pin
hahii18-May-09 11:50
hahii18-May-09 11:50 
AnswerRe: Tree view Pin
alisolution20-May-09 21:00
alisolution20-May-09 21:00 
QuestionGenerating site "posts" Pin
teejayem18-May-09 10:38
teejayem18-May-09 10:38 
AnswerRe: Generating site "posts" Pin
Yusuf18-May-09 11:54
Yusuf18-May-09 11:54 
GeneralRe: Generating site "posts" Pin
teejayem18-May-09 12:01
teejayem18-May-09 12:01 
AnswerRe: Generating site "posts" Pin
teejayem18-May-09 12:41
teejayem18-May-09 12:41 
I think i figured it out. The solution i found is something like this:

(i know this won't generate the markup in the original post, this is in a seperate test project)

ContentPlaceHolder leftContent = (ContentPlaceHolder)Master.FindControl("leftContent");

HtmlGenericControl div = new HtmlGenericControl("div");
div.Attributes.Add("class", "post");

HtmlGenericControl h2 = new HtmlGenericControl("h2");
h2.InnerText = "My Header";

HtmlGenericControl p = new HtmlGenericControl("p");
p.InnerText = "This is some  content.";

div.Controls.Add(h2);
div.Controls.Add(p);

leftContent.Controls.Add(div);


which will then generate this:
<div class="post"><h2>My Header</h2><p>This is some  content.</p></div>



Is there a better way to achieve what i'm trying to do? I feel like i'm going against the grain here.

Don't be overcome by evil, but overcome evil with good

AnswerRe: Generating site "posts" Pin
PauloCastilho18-May-09 12:52
PauloCastilho18-May-09 12:52 
GeneralRe: Generating site "posts" Pin
teejayem18-May-09 13:22
teejayem18-May-09 13:22 
QuestionWrite to CSV in C# asp.net Pin
Civic0618-May-09 7:50
Civic0618-May-09 7:50 
AnswerRe: Write to CSV in C# asp.net Pin
ToddHileHoffer18-May-09 8:16
ToddHileHoffer18-May-09 8:16 
GeneralRe: Write to CSV in C# asp.net Pin
Civic0619-May-09 4:21
Civic0619-May-09 4:21 
GeneralRe: Write to CSV in C# asp.net Pin
ToddHileHoffer19-May-09 4:37
ToddHileHoffer19-May-09 4:37 
QuestionWhy does button’s click subroutine not execute when RequiredFieldValidator is false? Pin
bigmish218-May-09 4:18
bigmish218-May-09 4:18 
AnswerRe: Why does button’s click subroutine not execute when RequiredFieldValidator is false? Pin
Ian McCaul18-May-09 4:47
Ian McCaul18-May-09 4:47 
GeneralRe: Why does button’s click subroutine not execute when RequiredFieldValidator is false? Pin
bigmish218-May-09 5:04
bigmish218-May-09 5:04 
GeneralRe: Why does button’s click subroutine not execute when RequiredFieldValidator is false? Pin
El_Programmer18-May-09 5:25
El_Programmer18-May-09 5:25 
GeneralRe: Why does button’s click subroutine not execute when RequiredFieldValidator is false? Pin
bigmish218-May-09 6:06
bigmish218-May-09 6:06 
GeneralRe: Why does button’s click subroutine not execute when RequiredFieldValidator is false? Pin
El_Programmer18-May-09 6:31
El_Programmer18-May-09 6:31 
GeneralRe: Why does button’s click subroutine not execute when RequiredFieldValidator is false? Pin
N a v a n e e t h18-May-09 6:37
N a v a n e e t h18-May-09 6:37 
GeneralRe: Why does button’s click subroutine not execute when RequiredFieldValidator is false? Pin
bigmish218-May-09 7:21
bigmish218-May-09 7:21 
QuestionSession Size Pin
mehrdadc4818-May-09 4:11
mehrdadc4818-May-09 4:11 
AnswerRe: Session Size Pin
N a v a n e e t h18-May-09 6:13
N a v a n e e t h18-May-09 6:13 
AnswerRe: Session Size Pin
Yusuf18-May-09 6:46
Yusuf18-May-09 6:46 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.