Home Search Member List Faq Register Login  
UltimateEditor
Re: UltimateEditor1.EditorHtml Return An Emtpy String

Thread Starter: gdycus   Started: 10-15-2005 4:25 PM   Replies: 8
 Karamasoft Support Forums » General Discussions » UltimateEditor » Re: UltimateEditor1.EditorHtml Return An Emtpy String
 Printable Version    « Previous Thread   Next Thread »
  15 Oct 2005, 4:25 PM
gdycus is not online. Last active: 9/5/2006 11:57:24 AM gdycus

Top 10 Posts
Joined on 10-14-2005
Posts 39
UltimateEditor1.EditorHtml Return An Emtpy String

Do you have any idea why the following code would interfere with the UltimateEditor? It is custom control control that creates a button that will disable dynamically when a user press the button. UltimateEditor1.EditorHtml return an empty string whenever I have the following control on the page. I am assuming it has something to do with the javascript that disables the button. Thanks for your help!


Imports SystemImports System.ComponentModel

Public Class DisableButton   Inherits System.Web.UI.WebControls.Button

Private m_waitText As String = "Please wait..."<Category("Appearance"), _Description("The text displayed by the button after it has been clicked."), _DefaultValue("Please Wait...")> _

Public Property WaitText() As String   Get      Return m_waitText   End Get

   Set      m_waitText = value   End Set

End Property

Protected Overloads Overrides Sub OnPreRender(ByVal e As EventArgs)

   Dim sb As System.Text.StringBuilder = New System.Text.StringBuilder   sb.Append("if (typeof(Page_ClientValidate) == 'function') { ")   sb.Append("if (Page_ClientValidate() == false) { return false; }} ")   sb.AppendFormat("this.value = '{0}';", Me.waitText)   sb.Append("this.disabled = true;")   sb.Append(Me.Page.GetPostBackEventReference(Me))   sb.Append(";")

   Me.Attributes("onclick") = sb.ToString   MyBase.OnPreRender(e)

End Sub

End Class


 


  
  15 Oct 2005, 5:06 PM
Karamasoft is not online. Last active: 5/8/2018 10:36:45 AM Karamasoft

Top 10 Posts
Joined on 09-05-2004
Posts 6,820
Re: UltimateEditor1.EditorHtml Return An Emtpy String
Can you try adding ValidateRequest="false" in your Page directive in your ASPX page as follows:

<%@ Page language="c#" ValidateRequest="false" Codebehind="YourPage.aspx.cs" AutoEventWireup="false" Inherits="YourProject.YourPage" %>

  
  16 Oct 2005, 7:44 PM
gdycus is not online. Last active: 9/5/2006 11:57:24 AM gdycus

Top 10 Posts
Joined on 10-14-2005
Posts 39
Re: UltimateEditor1.EditorHtml Return An Emtpy String
I have had ValidateRequest=False the entire time. As long I do not include the above custom control on the web page, then the editor works fine. Not sure what's going on??

  
  16 Oct 2005, 8:29 PM
Karamasoft is not online. Last active: 5/8/2018 10:36:45 AM Karamasoft

Top 10 Posts
Joined on 09-05-2004
Posts 6,820
Re: UltimateEditor1.EditorHtml Return An Emtpy String

Is this custom control a type of input type="file" used to to upload a file or your form has enctype as multipart/form-data? Then, it would cause the form fileds could not be reached through Request.Form, which then cause EditorHtml property to disappear. Could you please make sure that you can get other controls' values through Request.Form in your page?


  
  17 Oct 2005, 12:54 PM
gdycus is not online. Last active: 9/5/2006 11:57:24 AM gdycus

Top 10 Posts
Joined on 10-14-2005
Posts 39
Re: UltimateEditor1.EditorHtml Return An Emtpy String

I can retrieve data from all other form fields on postback. Just not the Ultimate Editor with this custom control on the page. As long as I remove my custom control it works fine. The customer control is simply a button that will disable via javascript whenever the button is pressed to keep user from submitting a form multiple times. Thanks!


  
  17 Oct 2005, 1:32 PM
Karamasoft is not online. Last active: 5/8/2018 10:36:45 AM Karamasoft

Top 10 Posts
Joined on 09-05-2004
Posts 6,820
Re: UltimateEditor1.EditorHtml Return An Emtpy String
It looks like your custom control prevents the regular submit operation by overriding it, which would cause the hidden form value of UltimateEditor not being set. We would recommend you to make the following function call in your OnPreRender event by appending it to sb in order to set the hidden variable of UltimateEditor manually:

UltimateEditors['UltimateEditor1'].ue7d();

Note that you should replace UltimateEditor1 with the ID of your UltimateEditor control.

Therefore, your OnPreRender sub should look like the following:

Protected Overloads Overrides Sub OnPreRender(ByVal e As EventArgs)

   Dim sb As System.Text.StringBuilder = New System.Text.StringBuilder
   sb.Append("UltimateEditors['UltimateEditor1'].ue7d();")
   sb.Append("if (typeof(Page_ClientValidate) == 'function') { ")
   sb.Append("if (Page_ClientValidate() == false) { return false; }} ")
   sb.AppendFormat("this.value = '{0}';", Me.waitText)
   sb.Append("this.disabled = true;")
   sb.Append(Me.Page.GetPostBackEventReference(Me))   sb.Append(";")
   Me.Attributes("onclick") = sb.ToString
   MyBase.OnPreRender(e)

End Sub


  
  03 Dec 2005, 4:59 PM
gdycus is not online. Last active: 9/5/2006 11:57:24 AM gdycus

Top 10 Posts
Joined on 10-14-2005
Posts 39
Re: UltimateEditor1.EditorHtml Return An Emtpy String

What would I need to do with the following script if there are multiple editors on the same page. Thanks for your help!

Grady


  
  03 Dec 2005, 5:01 PM
gdycus is not online. Last active: 9/5/2006 11:57:24 AM gdycus

Top 10 Posts
Joined on 10-14-2005
Posts 39
Re: UltimateEditor1.EditorHtml Return An Emtpy String

What would I need to do with the following script if there are multiple editors on the same page. Thanks for your help!

Grady

Dim sb As System.Text.StringBuilder = New System.Text.StringBuilder
sb.Append("UltimateEditors['UltimateEditor1'].ue7d();")
sb.Append("if (typeof(Page_ClientValidate) == 'function') { ")
sb.Append("if (Page_ClientValidate() == false) { return false; }} ")
sb.AppendFormat("this.value = '{0}';", Me.waitText)
sb.Append("this.disabled = true;")
sb.Append(Me.Page.GetPostBackEventReference(Me))   sb.Append(";")
Me.Attributes("onclick") = sb.ToString
MyBase.OnPreRender(e)


  
  04 Dec 2005, 10:14 AM
Karamasoft is not online. Last active: 5/8/2018 10:36:45 AM Karamasoft

Top 10 Posts
Joined on 09-05-2004
Posts 6,820
Re: UltimateEditor1.EditorHtml Return An Emtpy String
It depends on the IDs of your UltimateEditor controls, for example, if you have 3 UltimateEditor controls having UltimateEditor1, UltimateEditor2 and UltimateEditor3 as control IDs, then:

Dim sb As System.Text.StringBuilder = New System.Text.StringBuilder
sb.Append("UltimateEditors['UltimateEditor1'].ue7d();")
sb.Append("UltimateEditors['UltimateEditor2'].ue7d();")
sb.Append("UltimateEditors['UltimateEditor3'].ue7d();")
sb.Append("if (typeof(Page_ClientValidate) == 'function') { ")
sb.Append("if (Page_ClientValidate() == false) { return false; }} ")
sb.AppendFormat("this.value = '{0}';", Me.waitText)
sb.Append("this.disabled = true;")
sb.Append(Me.Page.GetPostBackEventReference(Me))   sb.Append(";")
Me.Attributes("onclick") = sb.ToString
MyBase.OnPreRender(e)


  
 Page 1 of 1 (9 items)
Karamasoft Support Forums » General Discussions » UltimateEditor » Re: UltimateEditor1.EditorHtml Return An Emtpy String

You can add attachments
You can post new topics
You can reply to topics
You can delete your posts
You can edit your posts
You can create polls
You can vote in polls
Forum statistics are enabled
Forum is unmoderated

© 2002-2020 Karamasoft LLC. All rights reserved.