Object expected error with radalert

3 posts, 1 answers
  1. Michael Love
    Michael Love avatar
    49 posts
    Member since:
    Sep 2009

    Posted 28 Sep 2009 Link to this post

    Hi there.

    I was just trying to add a simple radalert to my aspx page that I call from my code behind upon successful completion of a task.

    Here is the code I am executing from inside a button click handler:


    string scriptstring = "radalert('Task information loaded successfully!', 330, 210);";



    RadScriptManager.RegisterStartupScript(this, this.GetType(), "radalert", scriptstring, true);

    When I execute the code, I get the following error:

    Error: Object expected

    When looking a the page source, the error is occurring on the first open tag here:

    <script type="text/javascript">
    radalert('Task information loaded successfully!', 330, 210);Sys.Application.initialize();
    Sys.Application.add_init(function() {
        $create(Telerik.Web.UI.RadAjaxManager, {"_updatePanels":"","ajaxSettings":[],"clientEvents":{OnRequestStart:"",OnResponseEnd:""},"defaultLoadingPanelID":"","enableAJAX":true,"enableHistory":false,"links":[],"styles":[],"uniqueID":"ctl00$RadAjaxManager1","updatePanelsRenderMode":0}, null, null, $get("ctl00_RadAjaxManager1"));
    Sys.Application.add_init(function() {
        $create(Telerik.Web.UI.RadTabStrip, {"_selectedIndex":0,"_skin":"Default","clientStateFieldID":"ctl00_RadTabStrip1_ClientState","selectedIndexes":["0"],"tabData":[{},{},{},{},{}]}, null, null, $get("ctl00_RadTabStrip1"));

    I am probably missing something obvious. Any help provided would be much appreciated.



  2. Answer
    Shinu avatar
    17764 posts
    Member since:
    Mar 2007

    Posted 29 Sep 2009 Link to this post

    Hello Michael,

    Have you added RadWindowManager on page?
    Also checkout the following KB article which describes how to call RadAlert from code behind.
    Calling radalert from codebehind

  3. Michael Love
    Michael Love avatar
    49 posts
    Member since:
    Sep 2009

    Posted 05 Oct 2009 Link to this post

    Yep, I was missing the window manager. I thought I had one on the page, but it was on the master page.

    Thanks, Mike
Back to Top