Expected Behavior
Show-ModalDialog -Control "PowerShellRunner" `
-Parameter @{
id="{110D559F-DEA5-42EA-9C1C-8A5DF7E70EF9}";
db="master";
lang="en";
ver="1"
scriptId="{16670A5E-AA62-4EE2-A9C3-C8466BEB45C2}"
scriptDb="master"
}
Should return "yes" or "no" based on what the response for the dialog was.
Also usable from C#:
private void Method(ClientPipelineArgs args)
{
if (args.IsPostBack)
{
if (args.HasResult)
{
string scriptResult = args.Result?.ToLower();
if (scriptResult == "yes")
{
// Do something
}
}
}
else
{
var str = new UrlString(UIUtil.GetUri("control:PowerShellRunner"));
str.Append("id", dataItem.ID.ToString());
str.Append("db", dataItem.Database.Name);
str.Append("lang", dataItem.Language.Name);
str.Append("ver", dataItem.Version.Number.ToString(CultureInfo.InvariantCulture));
str.Append("scriptId", scriptItem.ID.ToString());
str.Append("scriptDb", scriptItem.Database.Name);
dialogUrl = str.ToString();
SheerResponse.ShowModalDialog(dialogUrl, true);
args.WaitForPostBack();
}
}
The last not empty line is used as the result.
Expected Behavior
Should return "yes" or "no" based on what the response for the dialog was.
Also usable from C#:
The last not empty line is used as the result.