Radalert from server-side localized !..

4 posts, 0 answers
  1. fer
    fer avatar
    10 posts
    Member since:
    Aug 2012

    Posted 08 Sep 2010 Link to this post


    there is a new localization text option for radwindow

    but how can i do it with radalert called like this from codebehind.

    Label1.Text = "<script language='javascript'> window.onload = function(){radalert('My Message.', 300, 150);}</script>";
  2. Shinu
    Shinu avatar
    17764 posts
    Member since:
    Mar 2007

    Posted 09 Sep 2010 Link to this post


    The following KB Article shows how to call alert from server code.
    Calling radalert from codebehind

    Also check the blog : Executing JavaScript function from server-side code

  3. fer
    fer avatar
    10 posts
    Member since:
    Aug 2012

    Posted 09 Sep 2010 Link to this post

    i was asking just localizing .
    ok i done it by calling a function with message param
    i put a function in asp code

    but there is still a problem calling function with mesaj contains a hyperlink
    i call it like this

    MesajLabel.Text = "<script type='text/javascript'>window.onload = function(){OpenAlert('<h4><strong>My mesagge !..</strong></h4><br/>Please do something..<br/><br/>To use click the link <asp:HyperLink ID='HLink' runat='server' NavigateUrl='~/Myasp.aspx' Text=Link'>HyperLink</asp:HyperLink>');}</script>";

    without hyperlink it works.
  4. Georgi Tunev
    Georgi Tunev avatar
    7207 posts

    Posted 13 Sep 2010 Link to this post

    Hello fer,

    I see 3 major problems in your code:
    1. You are using window.onload - when this event is fired, the ASP.NET AJAX controls (including our RadControls) are still not fully loaded and operational on the page.
    2. You use an asp:label control to output the JavaScript code which is not recommended when working with ASP.NET AJAX
    3. You try to pass an asp:hyperlink control as a parameter to a function - this will not work.

    Please check the blog post that Shinu referred to for more information on how to call JavaScript from server in ASP.NET AJAX - I would recommend to use ScriptManager's RegisterStartupScript() method and to use a standard HTML hyperlink (A).

    Georgi Tunev
    the Telerik team
    Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items
Back to Top