Click here to Skip to main content
15,867,568 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more: , +
Hello All,

I have a website which is on asp.net. My requirement is that my client wants that he need authority to edit .aspx page on his end. Like If he want to add new image or remove some content.
So please guide me what is best way to do this. I have tried one thing. I have saved HTML content of page in database which is sql server. The Column which contains HTML I am displaying in .aspx page. which is working fine except some design issue. Please let me know if there is any better way to do it.

Thanks in Advance
Neetesh Agarwal
Posted
Comments
Herman<T>.Instance 26-Aug-15 10:29am    
He should have a copy local on that machine. Change that copy, upload it to the serverfolder and restart the webserver (like IISRESET)

Wow - so many ways, so few good ones.

If the client is willing to pay for a CMS (Content Management System) then that's the best way. It takes a lot of resources to set up though.

If the requirement is design changes, as long as it is a website and not a web application then that's fine (for the most part). You can change the markup but not the code-behind.

If it's a web application or just some text or image changes and not the whole page or design, then you can store these in a db and load them at run time. You will have to give the client some portal to be able to edit and update these items. This describes a very dumbed down CMS

As with any dev, you will have to tell you client that there are several options depending on the situation. What's different here is the span of cost ranges from a few hours to a whole CMS and CMS-dev time (many £1000's)
 
Share this answer
 
Comments
Afzaal Ahmad Zeeshan 26-Aug-15 10:38am    
A good answer, Andy. Umbraco is a free CMS for ASP.NET! :-) Just because you mentioned client would have to pay for CMS.

Plus, programmer can himself create a CMS for his client.
Andy Lanng 26-Aug-15 10:40am    
That's true. there are some free cms's out there. I have never had a change to get to grips with any myself. Creating a cms is a good plan which I only hinted at in my solution.
That is exactly why Content management systems[^] were introduced. You can create a system for your applications so that your clients are provided with features, in a GUI mode. They don't even have to change anything, they can apply templates, change the content, update or even delete the content. Allowing the users or clients to edit the HTML files, or ASP.NET HTML files (e.g. aspx, cshtml, vbhtml etc.), not only because they are compiled when you build the solution to generate dynamic HTML files for users' requests (see Solution 3 by Sergey for more on this) but the main thing is that client might mess up with the interface, HTML elements, syntax and much more. For this, CMS provides you with a great way to create a system that maintains the template but still allows the client to fully use the application.

CMSs provide clients with features to edit the web pages (which are the aspx pages), they can use WYSIWYG editors such as CKEditor or others to write the content, add images or other multimedia. Then saving the content would save it as HTML content, which can be rendered all by the CMS itself. I would recommend that you read more about these systems, ASP.NET also can be used with CMS, you can search for some CMS, Umbraco[^] is one of them, even official ASP.NET website uses Umbraco.

For a working example, have a look at Wordpress (that is a CMS, more than a blogging website), or a simple example is the CodeProject article editor, you don't need to write the HTML for that, you can write it in plain-text!
 
Share this answer
 
v3
Comments
Sergey Alexandrovich Kryukov 26-Aug-15 10:37am    
Good, 5ed, but I'm afraid the problem is just the inquirer don't understand the whole idea of ASP.NET. Please see Solution 3.
—SA
Afzaal Ahmad Zeeshan 26-Aug-15 10:44am    
Thank you, Sergey.
Editing web pages on a server is difficult, and very dangerous.
It's difficult, because you need to be aware that users could be using the page(s) while you are editing them, so any changes need to be applied as a complete set to avoid "complications" with the user experience.

And it's dangerous to edit them on the live machine, if you make even a trivial mistake, it's the customers who get the fun and games - depending on what the website is doing, and how bad the mistake is, this could cost serious money!
You should always edit off line, against a development Database to ensure it is as good as it can be before you update the production system.

It's also dangerous to allow on-line editing, because it leaves massive security holes that are very easy to exploit - and then your site could be taken over by a competitor, disgruntled employee, or otherwise compromised.

Seriously: persuade your client that it's not a good idea, and provide him with tools to modify, test, and publish his page. FTP and a local IIS is a good start.
 
Share this answer
 
Comments
Afzaal Ahmad Zeeshan 26-Aug-15 10:46am    
Indeed, but the client was interested in adding images only! ;-)

I think, CMS is what he is looking for.
Neetesh Agarwal 26-Aug-15 10:51am    
Not Only Images. He can edit Text content , Hyper link etc.

You are right CMS seems to be better option. Thanks
Afzaal Ahmad Zeeshan 26-Aug-15 11:04am    
Yes, in other words you only want him to change how the pages look, or what is written in the documents. CMS is enough for that, the back-end pages for ASP.NET would cause a lot of problems, because they need to be compiled also!
Those files are not intended to be edited by anyone during production. The whole idea of ASP.NET: its files are using to generate HTTP response dynamically, based on some data, in response to HTTP request, taking into account request data. So, the short answer is: use ASP.NET properly. The idea is: the user edit data on client side and sends it, not ASP.NET files; and the ASP.NET files produce HTML file in response, depending on the user data, and change the state of the server-side data, say, store the user's data in a database.

I'm afraid to say that it would be beyond the format of Quick Questions & Answer format to explain how to use ASP.NET and do development. You just need to learn it. I gave you the very basic idea.

—SA
 
Share this answer
 
Comments
Afzaal Ahmad Zeeshan 26-Aug-15 10:45am    
5ed; for mentioning the valid point of ASP.NET files.
Sergey Alexandrovich Kryukov 26-Aug-15 12:15pm    
Thank you, Afzaal.
—SA
Neetesh Agarwal 26-Aug-15 10:50am    
Thanks Sergey.
Sergey Alexandrovich Kryukov 26-Aug-15 12:15pm    
You are very welcome.
Good luck, call again.
—SA

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900