|
Not catching the postback event ?
Last post 01-18-2010, 3:03 AM by Kenneth. 21 replies.
-
03-08-2005, 4:16 PM |
-
Larskohsel
-
-
-
Joined on 01-12-2005
-
Denmark
-
Posts 18
-
-
|
Not catching the postback event ?
Hi Its strange. I have suddenly lost the postback event. If I make a clean example of including an editor (Editor1) in a aspx and include the following in the codebehind: Private Sub Editor1_PostBackCommand(ByVal sender As Object, ByVal e As System.Web.UI.WebControls.CommandEventArgs) If String.Compare(e.CommandName, "Save", True) = 0 Then Label1.Text = "gem KNAPPEN" End If End Sub
Nothing happens. It seems that the event is not fired when hitting the save button.
Any ideas ?
regards Lars Kohsel
|
|
-
03-08-2005, 4:27 PM |
-
Larskohsel
-
-
-
Joined on 01-12-2005
-
Denmark
-
Posts 18
-
-
|
Re: Not catching the postback event ?
Just wanted to say that it has worked before and also works on the production server CE v4.0.0.4. /Lars Kohsel
|
|
-
03-09-2005, 10:25 AM |
-
03-09-2005, 10:25 AM |
-
03-09-2005, 10:34 AM |
-
cutechat
-
-
-
Joined on 07-22-2004
-
-
Posts 2,332
-
-
|
Re: Not catching the postback event ?
Did the VB.NET code miss something ? Private Sub Editor1_PostBackCommand(ByVal sender As Object, ByVal e As System.Web.UI.WebControls.CommandEventArgs) Handles Editor1.PostBackCommand
?
|
|
-
03-09-2005, 11:24 AM |
-
Larskohsel
-
-
-
Joined on 01-12-2005
-
Denmark
-
Posts 18
-
-
|
Re: Not catching the postback event ?
I got the catch_save_button_click working, but my application still does not catch the postbackevent. Can other usercontrols in the page interfere with a postback event ? I have put in a skmMenu in the top. regards Lars Kohsel
|
|
-
03-09-2005, 11:38 AM |
-
Larskohsel
-
-
-
Joined on 01-12-2005
-
Denmark
-
Posts 18
-
-
|
Re: Not catching the postback event ?
The save button causes a postback but the sub below is not catched ???? PrivateSub Editor1_PostBackCommand(ByVal Sender AsObject, ByVal e As System.Web.UI.WebControls.CommandEventArgs) Handles Editor1.PostBackCommand IfString.Compare(e.CommandName, "Save", True) = 0 Thensavedata() 'dataBinder()EndIfEndSub
|
|
-
03-09-2005, 1:04 PM |
-
Larskohsel
-
-
-
Joined on 01-12-2005
-
Denmark
-
Posts 18
-
-
|
Re: Not catching the postback event ?
Found a new bug !
just spent half a day messing around with my code and testing your sample code just to find that the
Editor1.DisableItemList = "InsertTextBox, InsertInputSubmit, InsertInputReset, InsertInputText, InsertInputPassword, InsertInputhidden, InsertListBox, InsertDropDown, InsertCheckBox, InsertRadioBox"
in the page_load sub messes up the postback event.
Not very happy Lars Kohsel
|
|
-
03-10-2005, 2:10 AM |
-
cutechat
-
-
-
Joined on 07-22-2004
-
-
Posts 2,332
-
-
|
Re: Not catching the postback event ?
Lars Kohsel: Thanks very much.
I have found the reason too . I will modify the code to fix the bug . Regards , Terry .
|
|
-
03-10-2005, 2:11 AM |
-
cutechat
-
-
-
Joined on 07-22-2004
-
-
Posts 2,332
-
-
|
Re: Not catching the postback event ?
Lars Kohsel : Currently for this bug , you could set the DisableItemList on the page's Init event handler . Regards , Terry .
|
|
-
03-10-2005, 4:41 AM |
-
Larskohsel
-
-
-
Joined on 01-12-2005
-
Denmark
-
Posts 18
-
-
|
Re: Not catching the postback event ?
Thanks, that worked For new releases could you please provide a history log for the component. regards Lars Kohsel
|
|
-
05-25-2005, 3:41 AM |
-
trentk_iss
-
-
-
Joined on 04-29-2005
-
-
Posts 11
-
-
|
Re: Not catching the postback event ?
I got the same lost postback event problem but I was using Editor1.AutoConfigure = CuteEditor.AutoConfigure.Full_noform In my page_load event The fix worked ok but you need to use InsertForm instead of Form to get rid of the Form icon from the toolbar
|
|
-
01-06-2006, 5:49 AM |
-
kohsel
-
-
-
Joined on 10-07-2004
-
-
Posts 11
-
-
|
Re: Not catching the postback event ?
Well, but U didn't, did you....
Version 5.1 still has this bug
regards Lars Kohsel
|
|
-
02-27-2006, 10:30 AM |
-
Nilzor
-
-
-
Joined on 12-14-2005
-
-
Posts 8
-
-
|
Re: Not catching the postback event ?
trentk_iss wrote: | I got the same lost postback event problem but I was using
Editor1.AutoConfigure = CuteEditor.AutoConfigure.Full_noform
In my page_load event
The fix worked ok but you need to use InsertForm instead of Form to get rid of the Form icon from the toolbar
|
|
I'm not so sure we have nailed the bug nor the fix here. I lose events too, but because I
change the property myEditor.ConfigurationPath upon an event (SelectedNodeChanged) caught from another control. Changing certain properties seems to do something with the editor object that causes events to lose track... I'm not very into the inner working of event handling so I don't have any explanation to why, but it sure smells like a bug in CuteEditor.
I can't do a workaround in Page_Init, because other obejcts i need properties from have yet not been initialized at that stage.
Tips?
edit: Just to be clear, the change of configurationPath causes the event on the NEXT postback to be lost, not the one in progress. I.e. the line 'myEditor.PostBackCommand += new CommandEventHandler(myEditor_PostBackCommand);' doesn't seem to have any effect that particular cycle.
|
|
-
10-15-2009, 9:06 AM |
-
rmiller
-
-
-
Joined on 10-07-2009
-
-
Posts 18
-
-
|
Re: Not catching the postback event ?
I am also having this same problem with the current version 6.5. This is what happens.
I have created a custom drop down list and added it to the editor. This drop down list posts back, adds text to the edior, and enables or disables buttons based on the value of the drop down list. If I remove the code which disables and enables buttons, the drop down will continue to post back. If the code is added back, the drop down will only post back once...any subsequent post backs are lost.
Has any one found a solution for this problem? I really need to disable the save button based on the permissions of the file that was chosen by the user with the drop down. Currently, I cannot do this because of the post back problem.
|
|
-
10-19-2009, 11:37 PM |
-
cutechat
-
-
-
Joined on 07-22-2004
-
-
Posts 2,332
-
-
|
Re: Not catching the postback event ?
Hi,
We have fixed this issue and will provide an update soon.
Regards, Terry
|
|
-
10-20-2009, 12:18 AM |
-
cutechat
-
-
-
Joined on 07-22-2004
-
-
Posts 2,332
-
-
|
Re: Not catching the postback event ?
rmiller,
Can you post some demo code to descript your issue ?
Regards, Terry
|
|
-
10-26-2009, 9:46 AM |
-
rmiller
-
-
-
Joined on 10-07-2009
-
-
Posts 18
-
-
|
Re: Not catching the postback event ?
Sorry it took me so long to get back to you. I was out of town for a week.
Here's the code behind to create the drop down as well as the events that correspond to it.
override protected void OnInit(EventArgs args) { Editor1.Initializing += new System.EventHandler(Editor1_Initializing); Editor1.PostBackCommand += new System.Web.UI.WebControls.CommandEventHandler(Editor1_PostBackCommand); Editor1.TextChanged += new System.EventHandler(Editor1_TextChanged); base.OnInit(args); } private void Editor1_Initializing(object sender, EventArgs e) { loadDds(); }
protected void loadDds() { DropDownList templateDd = new DropDownList(); templateDd.ID = "fileDd"; templateDd.ToolTip = "Select Files"; templateDd.Font.Size = 10; ListItem item = new ListItem(); item.Text = "Select Custom File"; item.Value = "0"; templateDd.Items.Add(item); templateDd.AutoPostBack = true; templateDd.CssClass = "CuteEditorDropDown"; SqlConnection conn = new SqlConnection(datasource); conn.Open(); string sqlStr = "Select DISTINCT fileName, fileID from EmailApplicationSavedFiles where fileCreator='" + Session["emailApplicationUser"].ToString() + "' OR shareFile='1' OR shareFile='2' order by fileName"; SqlCommand cmd = new SqlCommand(sqlStr, conn); SqlDataReader reader = cmd.ExecuteReader(); while (reader.Read()) { item = new ListItem(); item.Text = cleanData.b(reader["fileName"].ToString()); item.Value = reader["fileID"].ToString(); templateDd.Items.Add(item);
} reader.Close(); conn.Close(); templateDd.SelectedIndexChanged += new EventHandler(templateDd_SelectedIndexChanged);
int position = Editor1.ToolControls.IndexOf("InsertDocument") + 1; Editor1.InsertToolControl(position, "fileID", templateDd); }
protected void templateDd_SelectedIndexChanged(object sender, EventArgs e) {
DropDownList list = (DropDownList)sender; string id = list.SelectedValue; if (list.SelectedValue.Equals("0")) { Session["fileLoaded"] = 0; Editor1.Text = "";
} else { string save = ""; string creator = ""; SqlConnection conn = new SqlConnection(datasource); conn.Open(); string sqlSTr = "Select fileText, shareFile, fileCreator from EmailApplicationSavedFiles where fileID='" + id + "'"; SqlCommand cmd = new SqlCommand(sqlSTr, conn); SqlDataReader reader = cmd.ExecuteReader(); if (reader.Read()) { Editor1.Text = cleanData.b(reader["fileText"].ToString()); save = reader["shareFile"].ToString(); creator = reader["fileCreator"].ToString(); } reader.Close(); conn.Close(); Session["fileLoaded"] = id;
//This if/else disables postback as described in the post if (save.Equals("1") && !creator.Equals(Session["emailApplicationUser"].ToString())) { Editor1.DisableItemList = "Save"; Editor1.ToolTip = "You only have read access on this file. You cannot save changes made to it"; } else { Editor1.DisableItemList = ""; }*/ }
}
protected void Editor1_PostBackCommand(object sender, CommandEventArgs e) {
if (e.CommandName.Equals("Save")) { if (Session["fileLoaded"].ToString().Equals("0")) { saveFileMPE.Show(); fileSavedLbl.Visible = false; saveFileBtn.Visible = true; thisFileUpdatedLbl.Visible = false; } else { updateFileSave();
} } else { focusedControlID.Value = "CE_Editor1_ID"; thisFileUpdatedLbl.Visible = false; } }
protected void updateFileSave() { SqlConnection conn = new SqlConnection(datasource); conn.Open(); SqlCommand cmd = new SqlCommand("EmailApplicationUpdateFile", conn); cmd.CommandType = CommandType.StoredProcedure; cmd.Parameters.AddWithValue("@fileID", Session["fileLoaded"].ToString()); cmd.Parameters.AddWithValue("@fileText", cleanData.Clean(Editor1.Text)); cmd.Parameters.AddWithValue("@lastSaveDate", System.DateTime.Now); cmd.Parameters.AddWithValue("@lastSavedBy", Session["emailApplicationUser"].ToString()); cmd.ExecuteNonQuery(); conn.Close(); thisFileUpdatedLbl.Visible = true; thisFileUpdatedLbl.Text = "File Saved"; } protected void Editor1_TextChanged(object sender, EventArgs e) { focusedControlID.Value = "CE_Editor1_ID"; }
//Editor Declaration
<CE:Editor ID="Editor1" runat="server" AllowPasteHtml="true" OnPostBackCommand="Editor1_PostBackCommand"
OnTextChanged="Editor1_TextChanged" Height="700px" Width="950px" EditCompleteDocument="True"
EnableStripStyleTagsCodeInjection="False" EditorWysiwygModeCss="~/CuteSoft_Client/CuteEditor/Themes/Custom/style.css"
UsePhysicalFormattingTags="True">
</CE:Editor>
|
|
-
11-04-2009, 10:29 AM |
-
rmiller
-
-
-
Joined on 10-07-2009
-
-
Posts 18
-
-
|
Re: Not catching the postback event ?
Hello Again,
I posted my source code, do you have any feedback or a fix for this issue? Thanks.
|
|
-
12-14-2009, 4:18 PM |
-
rmiller
-
-
-
Joined on 10-07-2009
-
-
Posts 18
-
-
|
Re: Not catching the postback event ?
I am still having this issue, and have not found a work around. In fact, the postback problem has grown in scope. If I change the style sheet based on a custom drop down list using this code based on the style sheet chosen by the user, any subsequent postbacks are lost.
Editor1.EditorWysiwygModeCss = "~/Default.css"
Is there anyway at all to resolve this issue? I've been waiting for well over a month for a response. Thank you.
|
|
Page 1 of 2 (22 items)
1
|
|
|