Dropdown in toolbar that does postback and insert?

Last post 02-09-2006, 6:37 PM by AngC. 0 replies.
Sort Posts: Previous Next
  •  02-09-2006, 6:37 PM 15801

    Dropdown in toolbar that does postback and insert?

    I am trying to create a custom dropdown in the toolbar that will do a postback to do some calculations and then insert the value calculated at the cursor position?  I know I could just use the "text" value and append it to the end but anyway in the postback server side code to do an insert into cursor position?  I was thinking maybe I could have the dropdown first do a client side insert of some sort of flag and then replace the flag in the server code but I am having troubles getting both client and server to fire (only get one or the other)
     
    Here is code sample:
    'config toolbar file:

    <item type="dropdown" name="Bookmarks" command="PostBack" width="85" text="BookmarkCalcs"/>


    'build the dropdowns in server side page load
    ...
    dropdown.Items.Add("Calculation1", "Calc1")
    dropdown.Attributes("onmouseup") = "CuteEditor_DropDownCommand(this,'PasteHTML')"  'this doesnt work?
    ...

    'routine to capture postback
    Private
    Sub Editor_PostBackCommand(ByVal sender As Object, ByVal e As System.Web.UI.WebControls.CommandEventArgs) Handles txtEditor1.PostBackCommand
    If e.CommandName = "Calc1" Then
         'do calculations .....
        txtEditor1.Text = txtEditor1.Text.Replace("Calc1", sValue)
    End If
    End Sub
     
    Thanks!!!!
View as RSS news feed in XML