suite4.net.FormDatabase Documentation

WebLoaderAlert.SerializeToSwfXml Method (String, String)

Serializes the WebLoaderAlert for processing by the WebLoader component. After the WebLoader has shown the a Alert, a specified JavaScript or VBScript function is called.

[Visual Basic]
Overloads Public Function SerializeToSwfXml( _
   ByVal scriptFunction As String, _
   ByVal scriptFunctionArgument As String _
) As String
[C#]
public string SerializeToSwfXml(
   string scriptFunction,
   string scriptFunctionArgument
);

Parameters

scriptFunction
The script function to be called after the rendering of the form has been completed.
scriptFunctionArgument
A parameter for use with the scriptFunction.

Return Value

An XML string representing the WebLoaderAlert.

Remarks

The WebLoader component will parse the XML string and create an alert box based on the string's contents.

Example


C# sample

private string AlertException(System.Exception ex)
{
    suite4.net.FormDatabase.WebLoaderAlert    webLoaderAlert;

    webLoaderAlert = new suite4.net.FormDatabase.WebLoaderAlert();
    webLoaderAlert.Title = ex.Source;
    webLoaderAlert.Message = ex.Message;
    return webLoaderAlert.SerializeToSwfXml();
} // end private string AlertException(System.Exception ex)
            

VB.Net sample
Private Function AlertException(ByVal ex As System.Exception) As String
    Dim webLoaderAlert As suite4.net.FormDataMyBase.WebLoaderAlert

    webLoaderAlert = New suite4.net.FormDataMyBase.WebLoaderAlert()
    webLoaderAlert.Title = ex.Source
    webLoaderAlert.Message = ex.Message
    Return webLoaderAlert.SerializeToSwfXml()
End Function
            

JavaScript sample
<script language="JavaScript">
<!--
var isInternetExplorer = navigator.appName.indexOf('Microsoft') != -1;
function WebLoader_DoFSCommand(command, args)
{
  if(command == 'RedirectToLogin')
  {
    window.location.assign(args);
  }
  else
  {
    var fsObj = isInternetExplorer ? document.all.WebLoader : document.WebLoader;
    var TableFrame = document.getElementById('DataIFrame');
    TableFrame.src = '/support/PostingTable.aspx?Refresh='  args;
  }
}
if(navigator.appName &;&; navigator.appName.indexOf('Microsoft') != -1
   &;&; navigator.userAgent.indexOf('Windows') != -1
   &;&; navigator.userAgent.indexOf('Windows 3.1') == -1)
{
  document.write('<script language=\"VBScript\"\>\n');
  document.write('On Error Resume Next\n');
  document.write('Sub WebLoader_FSCommand(ByVal command, ByVal args)\n');
  document.write('    Call WebLoader_DoFSCommand(command, args)\n');
  document.write('End Sub\n');
  document.write('</script\>\n');
}
//-->
</script<
            

See Also

WebLoaderAlert Class | suite4.net.FormDatabase Namespace | WebLoaderAlert.SerializeToSwfXml Overload List