Your Privacy Matters: We use our own and third-party cookies to improve your experience on our website. By continuing to use the website we understand that you accept their use. Cookie Policy
90
ToolbarItemType.CustomButton needs to RaisePostBack
posted

 _wheText.AddToolbarItem(ToolbarItemType.CustomButton); _wheText.Toolbar.Items.GetByType(ToolbarItemType.CustomButton).Key = "View HTML";

I am writing a web part.  I need to get this button to raise a postback and I do not see a RaisePostBack option that I can use in my C# code.

 

I have a toolbar button click event:

 

 

 

 

 

 

protected void wheText_ToolbarClick(object sender, ToolbarEventArgs e)

{if (e.Item.Key == "View HTML")

{

 

string input = ((WebHtmlEditor)sender).Text;

((

 

WebHtmlEditor)sender).Text = WordScrubUtil.ScrubWord(input);}

I need this click event to raise a postback.  How can I do that?

  • 7566
    Suggested Answer
    posted

    Hello nataliepowers,

     

    Thank you for posting this question in our community. In order to make this button to rise a post back you need to do the following:

     

    Infragistics.WebUI.WebHtmlEditor.ToolbarItemType button = new Infragistics.WebUI.WebHtmlEditor.ToolbarItemType();

    button=Infragistics.WebUI.WebHtmlEditor.ToolbarItemType.CustomButton;

    this.WebHtmlEditor1.AddToolbarItem(button);

    this.WebHtmlEditor1.Toolbar.Items.GetByType(Infragistics.WebUI.WebHtmlEditor.ToolbarItemType.CustomButton).Key = "View HTML";

    ((Infragistics.WebUI.WebHtmlEditor.ToolbarButton)(WebHtmlEditor1.Toolbar.Items.GetByType(Infragistics.WebUI.WebHtmlEditor.ToolbarItemType.CustomButton))).RaisePostback = true;

     

    I hope this information is helpful.

    If you have any further questions with this matter, do not hesitate to contact me.

     

    Sincerely,

    Georgi Sashev

    Developer Support Engineer

    Infragistics, Inc.

    http://www.infragistics.com/support