Related Links

paste news article from word and save in db

I have news articles that get written in MS Word and I want to be able to insert these into the db to be displayed on my website. What would be the best way of doing this and how would I keep line breaks ect? Thanks

Re: paste news article from word and save in db

I assume the reason you are posting from word is to be able to use the formating that you added while in word. There are two ways I can think of to do this.

1 make the final document an image and save that to the database. You could also save it as a pdf. An image can easily be saved to a database. These may have scaling issues depending on the screen size and resolution. As an example, online magazines are
having to reformat their pages to match the new retena display.

2 Include a Rich Text frame in your web site. This also allows some significant security risks and there are some compatability issues that you need to resolve. This frame allows some of the rich text but it is likely moderated and scanned.

Re: paste news article from word and save in db

Yes, that is one of the problems with merging Javascript and Razor. Any escaping that is done in the Javascript is removed by the request object in the razor section. You will have to use the request.unvalidated().form call to get any of the html that
you want to send to razor code. Keep in mind that this data could contain dangerous code such as SQL Injection so you should also escape it immediatly with server.htmlencode if you plan to save it to a database.

This is the reason for your getting that warning. The data in Rich Text can contain harmful scripts and you need to keep that in mind when using it.