Click here to Skip to main content
15,868,141 members
Articles / Web Development / IIS
Article

Allow editable content on your asp.net web pages.

Rate me:
Please Sign up or sign in to vote.
3.00/5 (3 votes)
6 Mar 20062 min read 35.3K   650   27   5
Allow editable content on your asp.net web pages.

Introduction

<o:p>

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.<o:p>

<o:p> 

<o:p>

View1.ViewMode = StickyView.View.mode.View<o:p>

You can write code on your web site to change the mode to edit mode<o:p>

View1.ViewMode = StickyView.View.mode.Edit<o:p>

<o:p> 

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<o:p>

<o:p> 

  <appSettings><o:p>

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

  </appSettings><o:p>

<o:p> 

I have not tested this on a web farm but basically you can add a UNC path on the web config<o:p>

<o:p> 

  <appSettings><o:p>

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

  </appSettings><o:p>

<o:p> 

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<o:p>

<o:p> 

validateRequest="false"<o:p>

<o:p> 

**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<o:p>

 

License

This article has no explicit license attached to it but may contain usage terms in the article text or the download files themselves. If in doubt please contact the author via the discussion board below.

A list of licenses authors might use can be found here


Written By
Web Developer
United States United States
This member has not yet provided a Biography. Assume it's interesting and varied, and probably something to do with programming.

Comments and Discussions

 
GeneralThanks Pin
mbaocha6-May-09 17:29
mbaocha6-May-09 17:29 
QuestionAccess to the TEXT property in code? Pin
craigtwyatt12-Sep-07 5:49
craigtwyatt12-Sep-07 5:49 
GeneralA print screen or a live demo! Pin
HB HB23-Mar-06 9:35
HB HB23-Mar-06 9:35 
GeneralFix your source file link Pin
fwsouthern7-Mar-06 18:56
fwsouthern7-Mar-06 18:56 
GeneralRe: Fix your source file link Pin
rmilian7-Mar-06 20:47
rmilian7-Mar-06 20:47 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.