Take the 2-minute tour ×
SharePoint Stack Exchange is a question and answer site for SharePoint enthusiasts. It's 100% free, no registration required.

I am working on a page layout, and this is what I have ...

<!-- Title -->
<SharePointWebControls:TextField FieldName="Title" runat="server" ID="Title" CssClass="emedia-spwc-global"></SharePointWebControls:TextField>

The field displays and edits no problem. But it is just a text field. How do I tell the control I want it to be displayed with in H1 tags with out wrapping the entire control in H1 tags.

Thanks

Mike

share|improve this question

1 Answer 1

up vote 5 down vote accepted

Use an EditModePanel to display two different controls when editing and displaying:

<PublishingWebControls:EditModePanel runat=server PageDisplayMode="Edit">
    <SharePointWebControls:TextField FieldName="Title" CssClass="emedia-spwc-global" runat="server" />
</PublishingWebControls:EditModePanel>

<PublishingWebControls:EditModePanel runat=server PageDisplayMode="Display">
    <h1>
        <SharePointWebControls:FieldValue FieldName="Title" CssClass="emedia-spwc-global" runat="server" />
    </h1>
</PublishingWebControls:EditModePanel>
share|improve this answer
    
Wow again Whitelaw! That was perfect! Thanks ... again –  mdumka Nov 10 '12 at 4:44

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.