in

SharePoint University

Clean slate. Nothing but SharePoint.
Go, SharePoint!

inherit RichImageField

Last post 08-14-2007 4:23 AM by taidokas. 0 replies.
Page 1 of 1 (1 items)
Sort Posts: Previous Next
  • 08-14-2007 4:23 AM

    inherit RichImageField

    Hello

     I'm trying to customize the RichImageField with this code

     

    namespace Test.SharePoint.WebControls
    {
        public class MyCustomCalendar : RichImageField
        {
           protected override void RenderFieldForDisplay(HtmlTextWriter output)
            {
                // create a new tempWriter to consume the output from the base class
                TextWriter tempWriter = new StringWriter();
                base.RenderFieldForDisplay(new HtmlTextWriter(tempWriter));
     
                // capture the output of the base class and do the required adjustments
                string newHtml = tempWriter.ToString().Replace("</span>&nbsp;", "</span>");
     
                // write out the corrected html 
                output.Write(newHtml);
            }
        }
    }

     And when i insert the assembly into my page layout i only throws

    "An unexpected error has occurred. " 

     

    I know my I have written the right thing in the page layout because if I exchange the code in the class library to inherit a image for example.

     

    What can be wrong?

     Please help!

Page 1 of 1 (1 items)

Need SharePoint Training? Attend a SharePoint Bootcamp!
Forum content (c) original posters. Everything else (c) 2008 SharePoint Experts, Inc.