PagePorter Class Library

FpUserControl Class

The control class for the shared borders, or other user controls.

For a list of all members of this type, see FpUserControl Members.

System.Object
   System.Web.UI.Control
      System.Web.UI.TemplateControl
         System.Web.UI.UserControl
            Parastream.Web.UI.FpUserControl

[Visual Basic]
Public Class FpUserControl
    Inherits UserControl
[C#]
public class FpUserControl : UserControl

Thread Safety

Public static (Shared in Visual Basic) members of this type are safe for multithreaded operations. Instance members are not guaranteed to be thread-safe.

Remarks

The FpUserControl class is one of the key pieces enabling FrontPage-style shared borders and user controls. You may find it beneficial to derive your user controls from FpUserControl if they can benefit from these features:

FpUserControl will always strip off all tags (<html>, <head>, etc) before the <body> tag. This allows you to put in style sheet links in your user control for a better experience in the designer. It also removes the <body> tag, if present.

FpUserControl can also optionally output any attributes on the <body> tag. This is the way the shared borders are implemented. See PassBodyAttributes for more information.

FpUserControl can also optionally correct any URLs in attributes that need to be offset. Use a comment tag in the following form: <!--fpoffseturl attr="name"--> before a tag that contains a URL that needs to be offset at runtime. Set attr to a name that begins with the string "attr" (i.e. "attr" or "attr2", etc.) and name to the attribute name associated with the URL. This syntax supports multiple attribute names to be specified in a single comment tag.

User controls don't have a sense of where they are, which can create problems if they are used in pages that reside in folders and subfolders from the project root. For example, let's say that the top shared border links to an image in the images folder, so the tag for it might look something like <img src="../images/myimage.jpg">. All fine and good if you're using the control from another page in the same folder as the top shared border control. But if you put the control in a page that resides in the root folder, the URL needs to look like "images/myimage.jpg". Likewise, if the page resides in the news/archives folder the URL would then need to look like "../../images/myimage.jpg".

Note: the "~/" URL prefix doesn't work in this situation.

Requirements

Namespace: Parastream.Web.UI

Assembly: FpCtrlsBase (in FpCtrlsBase.dll)

See Also

FpUserControl Members | Parastream.Web.UI Namespace