This project is read-only.

Pass Soubroutine to okscript / cancelscript of Alert

Aug 13, 2012 at 11:05 PM


I need help urgently please. How do I call a .net subroutine or c# soubroutine by passing the name to the okscript of the alert class.

Below is the source code in the Confirm.cs class

public static void Show(string message, string title, MessageBoxIcon icon, string okScriptstring, string cancelScript)
            PageContext.RegisterStartupScript(GetShowReference(message, title, icon, okScriptstring, cancelScript));

Currently I can pass:  "window.location.href='frmXXX.aspx?action=delete';" as okScripting and this works well. How do I pass a function other than javascript to okscripting?

Aug 16, 2012 at 3:51 AM

Suppose you have defined a function:

window.nav = function() {
Then you can invoke the Show method like this:
Confirm.Show("message", "title", .., "nav();", "");