name
name

Reputation:

ASP.NET webpage with basic html text

I have a specific Content Page (with an existing Master Page) that pretty much just has basic text wrapped with some <p>, <ul>/<li>, <h3>, <h4>, <blockquote> tags...like a blog post.
Is this ok to hardcode all of this html into my content page? Is there a better way (design-wise) to put text into an ASP.NET web page?

Upvotes: 1

Views: 244

Answers (4)

Lucas
Lucas

Reputation: 339

It depends on the objetive of the project... If you think that is going to grow into a big project you should considere using templates :)

Upvotes: 0

Jonathan Mayhak
Jonathan Mayhak

Reputation: 12536

Traditional HTML is perfectly fine with aspx pages.

You could create a master page (right click the project -> add new item -> select master page). After configuring this page, every time you create a new aspx page select the master page you just created as your masterpage template. Visual Studio will create a basic layout that includes <asp:content> tags. Just put your HTML markup there.

Upvotes: 0

TheTXI
TheTXI

Reputation: 37905

Look into MasterPages, which will allow you to define a basic template, and then each of your pages will consist of just a content section which you can fill in, thereby foregoing the need to have all that extra template code every single time.

Upvotes: 0

atfergs
atfergs

Reputation: 1684

Yes, that's fine. Just make sure that if you're actually using a Content Page (in that it's a child to a Master Page), you keep all your HTML within the ContentPlaceHolders.

Upvotes: 1

Related Questions