Jump to content
Xtreme .Net Talk

Recommended Posts

Posted (edited)

Ok call me silly here but i've never done this before, im currently making a portal/CMS. Ive done plenty of database selects inserts etc etc for ages, now ive come to the point in this new project where ive just realised something crucial... how on earth do i get the content in/out of the database as html?

 

I assume I have a textbox server control and insert the text in the database that the user has edited but how do i format it as html so rather than:

 

Hello!

 

It's:

 

<b>hello</b>

 

or whatever!

 

I want it to act like a normal text box but have say a bold button which makes selected text bold and can write that with <b> tags into a DB.

 

Please someone enlighten me ive been searching forums and my .net books this evening but havent found anything!

Edited by GregD
Posted

it sounds like you want to take html entered into a textbox and insert it into the database correct? Or do you want to take text entered into the text box and wrap html around it?

 

As for the database insert, I use sql parameters and I believe it will make any formatting changes that it needs to insert it into the database, you just need to tell it what datatype the input will be. If this sounds like what you need I can post some sample code for doing this.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...