How to save asp.net html articles - asp.net

I have asp.net web page on home page i want to add articles and news.
Which would be better way for saving articles store it on database or .xml or .html?

I think you should store it in a good normalized table structure. Put different meta information in different columns and put the article as html in a column.
If you were to store it in a file I'd recommend saving it in XML so that you can save meta information along with the article. But as you are using Database, meta information can be saved in other columns. So plain HTML is completely okay.

I'd say for any homepage type applications, saving content in files (be it xml, html or plan text) is enough.
Scott Hanselman's blog uses dasblog, which doesn't needs a database and simply stores all contents in text files in a folder.

Really? Thats like "what is better; a red or blue car". That said, db driven designs are more common

Related

Building a bespoke PDF brochure via web form or CMS

I'd like to set up a CMS that allows clients to generate a PDF brochure from a series of text inputs and text areas (rich text editor). Clients would fill out text inputs and then select (via a check box) which contents should appear in the exported PDF. This would then stitch together a PDF brochure containing pages only applicable to the options chosen by the client.
All the content is in a CMS with web pages and pdfs built on the fly as per the client's choices. A change in the content is then reflected immediately in the published docs meaning no redundant, out of date pdfs and the benefit of all the tools within the CMS (workflow, publishing dates, security, etc).
Does anyone know of any tools that do this?
Appreciate any help.
well your question require a lot of work to be done. I had similar requirement and what i have done i can brief here. I created multiple views which lets me select their columns and i have used my own rules for differentiating columns from test like {view.columnname}. when your save all information i have used itextsharp for pdf generation.
There is plenty of information on itextsharp.
You might be able to do this with design tools and reporting software, plugged into your CMS of choice. For example, you could use Wordpress, and then design your PDF output using iReport, and run it with Jasper. You'd have to work on the bit to translate user inputs to a query passed to the report, but that shouldn't be too much work.
One issue is that, regardless of the work you put into the design, when you attempt to share it, it wont look like a brochure at all, only sequential single page PDFs. As an alternative I found a website where you can upload or design your brochure, it can then be downloaded and shared as a flippable, digital brochure. If you are interested check out https://simplebooklet.com/learn/animated-tri-folds.php

Some reflection technique to copy the SharePoint list in Summary Links

Would there be a way to copy the entire list from the SharePoint Summary Links webpart? Think it will be very useful and handy thing to have.
Thanks,
If you are referring to being able to duplicate the configured summary links elsewhere in the web, you can do this:
configure one summary links web part exactly as you want it
export that web part from the dropdown menu at the top of the web part
this export is an xml rendering of the configured links so that might be useful to you too
upload that saved web part into the site collection web part gallery
insert that new web part elsewhere to have a duplicate instance of the summary links
note that the links have been saved as site relative so they should be good anywhere in the site collection

ASP.NET - best method for website where user can create articles (like a blog)

I'm an ASP.NET newbie, but not so new at programming in general.
I'm creating a commercial website, and I want to allow an admin to add new articles (an article consists of text, images and various properties such as category).
I am trying to decide the optimal Modus Operandi. This site is commercial, so SEO is a major consideration. This means that I want each url to be "unique". That is, if someone navigates to an article about raccoons, he should be redirected to www.mysite.com/articles/raccoons. This means - I can't have one page that loads the appropriate article dynamically a-la AJAX (gotta use deep-linking)
So how exactly do I do this? suppose the admin entered his text, uploaded the images and set the article properties. I create a new subfolder, save the images to the server (I understand that saving images to a DB is a big no-no), their addresses in a DB, and the content itself to the DB. But now what?
How do I go about creating the actual page?
Is there a function for creating a new aspx file? then what about its corresponding cs file? Or is it unwise to use aspx? Maybe plain html? but then how does it work with my site's master page? Or maybe just create another copy of a general aspx file which is populated with an article according to a parameter?
I would like to know what is the "smartest" approach before I dive in too deep.
You can Consider ASP.Net MVC for this. What you need is more like a Content Management System rather than a Blog, as you mentioned an administrator will add articles.
By Using ASP.Net MVC, you have a very clean implementation there, your urls will stay as you need it for SEO, You dont have to create aspx pages on the fly but the framework will let you deal with new urls from your class files.

ASP.Net MVC Blog content storage

I'm creating a blog in asp.net mvc for learning purpose so please no answers telling me i should use an open source blogengine. I need to understand how is the blog content going to work. So i have a table called "Blog" with a column called "Content". The "Content" will hold the blog i.e. text and images etc. Now i have the following questions:
What should be the datatype of content.
Is this the correct way of doing it i.e. saving the blog in a record.
What are the contants of this blog i.e. is it html with rich text and image urls and how does it actually work, i.e. where are these image urls be pointing to and how will my application render it.
Thanks.
Though you certainly could make it work with a single table, you probably want to use several tables to store the content. A basic implementation might look like:
One table for the periodical list of blog entries you have with columns for blog ID, perma-link/url, etc
One table for the tags associated with each blog id
One table for the blog entries themselves, consisting of a blog ID, blog body, etc
One table for comments, with blog ID, comment ID, comment body, etc
Everything would be linked together in the tables by the various IDs (blog ID, comment ID, etc) and your engine would load and render the body elements as specified by the ID requested.
Images, attachments, etc would be stored on a fileserver, and the rendered content would have hyperlinks to them.
This is by far a simplistic envisioning of it, and doesnt cover many aspects or issues. For instance, if you plan to store content such as images, etc in your DB you will need to have unique pointers for those, tables for those items and a way to resolve them as part of your MVC framework.
Start simple, and build up from there if you are just learning. Just build each table as you need it and go from there.
Not sure which DB you are using but assume SQL server for this example. You can store your blog content in a field as nvarchar(MAX). i dont see any issues with doing this

Exporting web applications pages to excel/pdf

We have a requirement to export different pages of our I.E. only web application to Excel/pdf documents.
The pages have graphics/grids/text, etc...They should also be printable as well.
I heard weSuperGoo mentioned, but have no experience with it.
I am in the research phase now and I wonder what tools/technologies/methods are out there for this task?
I would appreciate any pointers/direction.
Thanks!
We have used ABCpdf by WebSupergoo which includes the ability to retrieve a URL and convert it to a PDF (see documentation). This means all we need to do is provide a suitably formatted version of the page in plain old HTML and point ABCpdf at this URL and it will convert everything automatically for us - beats having to build the page up manually element by element.
I should add that this isn't perfect - we have had some issues relating to matters like paging (very difficult to page HTML when you need things like headers and footers on every page) but for simple uses it's up to the job.
You can get ABCpdf free if you're prepared to link to them.
To export to Excel, you can simply just export a HTML table as HTML and name the file whatever.xls. Excel will automatically convert the HTML table to a spreadsheet. I've been using that trick for many, many years. If you're using something like a DataGrid, then that makes it even easier to just write out the contents of the control to a HTML file (or string) and then return it as a .xls file.
For PDF, I recommend iTextSharp. It's really easy to use and has worked well for me for many years. You can use the iText (Java version) documentation or the iTextSharp documentation, the methods and classes are the same (maybe capitalization is different, but you should be able to figure it out.)
Links
http://itextsharp.sourceforge.net/

Resources