Thanks to visit codestin.com
Credit goes to www.codeproject.com

65.9K
CodeProject is changing. Read more.
Home

Allow editable content on your asp.net web pages.

starIconstarIconstarIconemptyStarIconemptyStarIcon

3.00/5 (3 votes)

Mar 6, 2006

2 min read

viewsIcon

35972

downloadIcon

650

Allow editable content on your asp.net web pages.

Introduction

This little control allows you to allow a web site manager to edit the content of a web page on the fly. Basically you can drag the control into any page and name the control with a unique name. Once this is completed you can write code that can flip the mode of the control to edit mode this will allow you enter free text and save it to the page.  The default will be set to view mode

 

To add this control customize your visual studio.net controls toolbox and Add/Remove items, then browse to the location where the StickyView.dll resides.

 

View1.ViewMode = StickyView.View.mode.View

You can write code on your web site to change the mode to edit mode

View1.ViewMode = StickyView.View.mode.Edit

 

All the content is stored to text files with the name of the control. So you must be sure to allow write access to the account running IIS plus you also need to include this on your web site’s web config

 

  <appSettings>

  <add key="StickyViewContentFolder" value="c:\StickyContent" />

  </appSettings>

 

I have not tested this on a web farm but basically you can add a UNC path on the web config

 

  <appSettings>

  <add key="StickyViewContentFolder" value="\\SHARED_DRIVE\SHARED_FOLDER" />

  </appSettings>

 

If you are going to allow HTML to be entered into the control you need to add this to every page holding the control in the page directive

 

validateRequest="false"

 

**Note if you name a control on one page for example to View1 and then have the same name in another page both controls will feed of the same content. This is done by design so you can share content across different sites if needed to do so. If you don’t want this kind of feature you need to make sure all of your controls are with a unique name.

 

Other important properties are viewwidth and viewheight