This is a migrated thread and some comments may be shown as answers.

Radalert from server-side localized !..

3 Answers 121 Views
Window
This is a migrated thread and some comments may be shown as answers.
fer
Top achievements
Rank 1
fer asked on 08 Sep 2010, 04:18 PM
Hi

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>";

3 Answers, 1 is accepted

Sort by
0
Shinu
Top achievements
Rank 2
answered on 09 Sep 2010, 06:47 AM
Hello,


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

-Shinu.
0
fer
Top achievements
Rank 1
answered on 09 Sep 2010, 10:37 AM
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.
0
Georgi Tunev
Telerik team
answered on 13 Sep 2010, 09:04 AM
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).

Regards,
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
Tags
Window
Asked by
fer
Top achievements
Rank 1
Answers by
Shinu
Top achievements
Rank 2
fer
Top achievements
Rank 1
Georgi Tunev
Telerik team
Share this question
or