Hi,
How to display RadWindowManager.RadAlert from shared ( static ) method. My scenario is as follows:
1. When a user click on a button a java script function is executed with that code:
2. After javascript function finished its work I call a static function into asp.net code behaind with PageMethods
and here is how SaveToXml method is defined
How to display RadWindowManager.RadAlert from shared ( static ) method. My scenario is as follows:
1. When a user click on a button a java script function is executed with that code:
Page.ClientScript.RegsterStartupScript(
Me
.
GetType
(),
"alert"
,
"OpenActiveX();"
,
True
)
2. After javascript function finished its work I call a static function into asp.net code behaind with PageMethods
function
OpenActiveX() {
try
{
var
xml = document.getElementById(
'MainContent_XmlTextReference'
).value;
...
PageMethods.SaveXmlFile(xml)
}
catch
(Err) {
alert(Err.description);
}
}
and here is how SaveToXml method is defined
<Services.WebMethod()> _
Public
Shared
Function
SaveXmlFile(
ByVal
xml
As
String
)
As
Boolean
' work with returned from java script data
Here need to display an alter when work with data is finished
Return
True
End
Function
I have
Public
Class
MyPage
Inherits
System.Web.UI.Page
Private
Shared
MyPageHandle
As
MyPage
Protected
Sub
Page_Load(sender
As
Object
, e
As
System.EventArgs)
Handles
Me
.Load
If
Not
Page.IsPostBack
Then
Try
MyPageHandle =
Me
...
End
If
End
Sub
<Services.WebMethod()> _
Public
Shared
Function
SaveXmlFile(
ByVal
xml
As
String
)
As
Boolean
...
MyPageHandle.RadWindowManager1.RadAlert(
"test"
, 100, 100,
"test"
, 0)
Return
True
End
Function
End
Class
add a RadWindowManager to web page named and after that try to call it from shared method
without success
Thank you