FreeTextBox

The no. 1 free ASP.NET HTML Editor.
Welcome to FreeTextBox Sign in | Join | Help
in Search

FreeTextBox with ASP.NET Ajax solution

Last post 05-25-2008, 11:53 PM by ctlatd2. 20 replies.
Page 2 of 2 (21 items)   < Previous 1 2
Sort Posts: Previous Next
  •  02-21-2008, 10:22 AM 8920 in reply to 7984

    Re: FreeTextBox with ASP.NET Ajax solution

    I´ve tried the nander´s workaround, and it seems to work well on IE, BUT it does not works with FireFox.
    Does anyone knows why?
    And, of course, how to solve it.
  •  02-25-2008, 2:00 PM 8927 in reply to 7984

    • nihk is not online. Last active: 02-25-2008, 2:14 PM nihk
    • Not Ranked
    • Joined on 02-26-2008
    • Tacloban, Philippines
    • Posts 2

    Re: FreeTextBox with ASP.NET Ajax solution

    I got a better solution without hacking. I don't know if it will work for your situation though, but it works fine for me. The solution? Dont Place the FreeTextBox inside an UpdatePanel.
    That's what I did.

    File.aspx

    <updatepanel>
     <triggers>
      <asyncpostbacktrigger id="btnSave" />
     </triggers>
    </updatepane>
    <freetextbox />
    <button id="btnSave" />


    File.aspx.vb (or <script>)

    protected sub btnSave_Click(sender as object, e as eventargs) handles btnSave.Click
     dim someText as string = freetextboxid.text
    end sub

    NOTE: I wrote the code above in semi-pseudo code... I assume you all know what that is


    Please visit my blogs:
    Web Development Blog: http://silverworks.wordpress.com/
    Other Blog: http://pokemoncollector.wordpress.com/
  •  03-11-2008, 3:40 PM 8972 in reply to 8927

    Re: FreeTextBox with ASP.NET Ajax solution

    Taking it out of the update panel is not a better solution and does not do what most people need.  Typically you put a control in the update panel when you need to change the content of that control, not just read it.  In my case I have an action that will load the freetextbox with text to be edited that relates to the selected on-screen record which would not be possible with your solution because I have freetextbox on the left of the =.
  •  03-24-2008, 5:19 PM 8997 in reply to 7987

    Re: FreeTextBox with ASP.NET Ajax solution

    Hi guys,

    I am using this control in C#. I worked out the same steps mentioned above. but it did not work for me. Later in the page load I did a minor modification. I gave the path of script file as below:

    Page.ClientScript.RegisterClientScriptInclude(

    "FTB-FreeTextBox" , "FreeTextBox/FTB-FreeTextBox.js" );

    Page.ClientScript.RegisterClientScriptInclude(

    "FTB-Utility" , "FreeTextBox/FTB-Utility.js" );

    Page.ClientScript.RegisterClientScriptInclude(

    "FTB-Toolbars" , "FreeTextBox/FTB-ToolbarItems.js" );

    Page.ClientScript.RegisterClientScriptInclude(

    "FTB-ImageGallery" , "FreeTextBox/FTB-ImageGallery.js" );

    Page.ClientScript.RegisterClientScriptInclude(

    "FTB-Pro" , "FreeTextBox/FTB-Pro.js" );

    Then it works fine but the control's border is missing whenever the updatepanel is updated. Later I included the control in a table and td with style as below:

    <

    asp : UpdatePanel ID ="UpdatePanel1" runat ="server">

    < ContentTemplate >

    < table border ="0" cellpadding ="0" cellspacing ="0">

    < tr >

    < td style ="border-style: solid; border-width:1px; border-color:#000000;">

    < FTB : FreeTextBox id ="ftbEditor" runat ="server" Width ="450" Height ="130px" ToolbarStyleConfiguration ="Office2003"

    ButtonSet ="Office2003" EnableHtmlMode ="False" PasteMode ="Text" GutterBackColor ="255, 255, 255" BackColor ="255, 255, 255"

    ToolbarLayout ="FontFacesMenu,FontSizesMenu,FontForeColorsMenu;Bold,Italic,Underline;BulletedList,NumberedList,Cut,Copy,Paste"

    FormatHtmlTagsToXhtml ="False" AllowHtmlMode ="True" ConvertHtmlSymbolsToHtmlCodes ="False" DesignModeBodyTagCssClass ="freetext"></ FTB : FreeTextBox >

    </ td >

    </ tr >

    </ table >

    < asp : Button ID ="btn1" runat ="server" Text ="Click" />

    </ ContentTemplate >

    </ asp : UpdatePanel >

    Now it works fine for me. The border does'nt disapper.

    Thanks guys for such a great solution...

  •  04-16-2008, 6:21 PM 9080 in reply to 7984

    Re: FreeTextBox with ASP.NET Ajax solution

    First of all thanks a lot for this posted solution - its works fu**in great!!!

    I'm using it in C# (.net 3.5) basically running the code senyl posted (2nd message in this thread), but without any "border" problems... :-)

    In my situation, the FreeTextBox is placed within a web user control placed nested within an asp.net AJAX TabControl. To get this working in the asp.net AJAX UpdatePanel, insert the following lines of server- code within the .aspx page holding the webusercontrol:

    #region FreeTextbox code

    /// <summary>
    /// FreeTextbox in update panel workaround
    /// </summary>
    public new void RegisterOnSubmitStatement(string key, string script)
    {
       
    ScriptManager.RegisterOnSubmitStatement(this, typeof(Page), key, script);
    }

    /// <summary>
    /// FreeTextbox in update panel workaround
    /// </summary>
    [Obsolete]
    public override void RegisterStartupScript(string key, string script)
    {
       
    string newScript = script.Replace("FTB_AddEvent(window,'load',function () {", "").Replace("});", "");
       
    ScriptManager.RegisterStartupScript(this, typeof(Page), key, newScript, false);
    }

    #endregion

    FTB is placed within the .ascx using

    <%@ Register assembly="FreeTextBox" namespace="FreeTextBoxControls" tagprefix="FTB" %>
    <
    FTB:FreeTextBox ID="FreeTextBox1" runat="server" JavaScriptLocation="ExternalFile"
    ButtonImagesLocation="ExternalFile"
    ToolbarImagesLocation="ExternalFile"
    SupportFolder="~/FreeTextBox/"></FTB:FreeTextBox>

    Within the webusercontrol .cs Page_Load insert

    protected void Page_Load(object sender, EventArgs e)
    {
       
    if (!Page.IsPostBack)
       {
       Page.ClientScript.RegisterClientScriptInclude("FTB-FreeTextBox", VirtualPathUtility.MakeRelative(Request.Path, "~/FreeTextBox/FTB-FreeTextBox.js"));
       Page.ClientScript.RegisterClientScriptInclude(
    "FTB-Utility", VirtualPathUtility.MakeRelative(Request.Path, "~/FreeTextBox/FTB-Utility.js"));
       Page.ClientScript.RegisterClientScriptInclude(
    "FTB-Toolbars", VirtualPathUtility.MakeRelative(Request.Path, "~/FreeTextBox/FTB-ToolbarItems.js"));
       Page.ClientScript.RegisterClientScriptInclude(
    "FTB-ImageGallery", VirtualPathUtility.MakeRelativ(Request.Path, "~/FreeTextBox/FTB-ImageGallery.js"));
       Page.ClientScript.RegisterClientScriptInclude(
    "FTB-Pro", VirtualPathUtility.MakeRelative(Request.Path, "~/FreeTextBox/FTB-Pro.js"));
       }

    Thanks again for your post, Nander! That's what's helping us people to get our code working!

     

  •  05-25-2008, 11:53 PM 9180 in reply to 9080

    Re: FreeTextBox with ASP.NET Ajax solution

    Thanks all! that is great work!
Page 2 of 2 (21 items)   < Previous 1 2
View as RSS news feed in XML
www.freetextbox.com