Forums
Forums are Read-Only. Use the new Support Center. To start a general discussion, use the General category when submitting your question.

Calling RegisterClientScriptBlock from within detail row

Last post 9/9/2008 12:17 PM by Nicholas Mahbouby. 4 replies.
Sort Posts: Previous Next
  • Nicholas Mahbouby

    Calling RegisterClientScriptBlock from within detail row

    8/30/2008 6:42 PM
    • Top 500 Contributor
    • Joined on 2/5/2008
    • Posts 74

    I have written a custom web server control, which calls Page.ClientScript.RegisterClientScriptBlock from within it's own Init method. The script works on a test web page but unfortunately the script is never rendered to the browser when I put the control inside a DetailRowTemplate. It seems the problem is that the expansion of the detail row is a callback and only affects the grid itself. The other DevExpress controls in the detail grid fire their ClientSideEventScripts fine but I can;t get my control to do the same thing. Is there a special way that the DevExpress controls achieve this?

  • Anonymous

    Re: Calling RegisterClientScriptBlock from within detail row

    9/1/2008 4:40 AM

    Hi Nicholas,

    You can't use standard ClientScriptManager (Page.ClientScript) on callbacks,
    no matter whether you are using any standard control or the ASPx one. If you
    perform any action with the ClientScriptManager, for example, register a script
    block, it simply won't be rendered. Our controls, for instance, render their scripts
    inside their markup and evaluate them on every callback manually via the
    eval(string scriptBlock) client function.

  • Nicholas Mahbouby

    Re: Calling RegisterClientScriptBlock from within detail row

    9/1/2008 6:30 AM
    • Top 500 Contributor
    • Joined on 2/5/2008
    • Posts 74

    Hi Victor. Is there a sample anywhere that shows how to do this? If not then perhaps you could let me know which file/method to look at in the DevExpress code. I have the source here but haven't looked at it much yet. Thanks - Nick

  • Anonymous

    Re: Calling RegisterClientScriptBlock from within detail row

    9/1/2008 8:24 AM

    Server side:

    void RegisterIncludeScript(Type type, string resourceName) method of the ASPxWebControl.

    Client side:

    _aspxRunStartupScripts() global function (DevExpress.Web.Scripts.Classes.js).

  • Nicholas Mahbouby

    Re: Calling RegisterClientScriptBlock from within detail row

    9/9/2008 12:17 PM
    • Top 500 Contributor
    • Joined on 2/5/2008
    • Posts 74

     Thanks

More from DevExpress
Live Chat
Have a pre-sales question?
Need assistance with your evaluation?
We are here to help.
Chat is one of the many ways you can contact members of the DevExpress Team. We are available Monday-Friday between 8:30am and 5:00pm Pacific Time.
If you need additional product information, require pre-sales assistance, or want help with your order, write to us at info@devexpress.com or call us at
+1 (818) 844-3383.