return value from ShowModalDialog in C# - InfoPath Dev
in

InfoPath Dev

return value from ShowModalDialog in C#

Last post 10-31-2005 12:05 AM by AndersR. 0 replies.
Page 1 of 1 (1 items)
Sort Posts: Previous Next
  • 10-31-2005 12:05 AM

    return value from ShowModalDialog in C#

    Hi

    i'm opening a modal dialog box prompting user for a custom login for access to a web service.

    this works fine, but the code itself is pretty ugly, so i wondered if anyone could tell me the right way to handle return values from modal dialogs in managed code?

    thanx
    //AndersR

    Object login = e.XDocument.UI.ShowModalDialog("loginModal.htm", e.XDocument, 305, 328, null, null);
    if ( login == null || login.ToString() == "" || login.ToString().Split('¤').Length < 3 )
    {
    e.XDocument.UI.Alert("Missing credentials in login");
    e.ReturnStatus = false;
    return;
    }
    else
    {
    String[] loginArray = login.ToString().Split('¤');
    SetLoginCredentials(loginArray[0],loginArray[1],loginArray[2]);
    }


Page 1 of 1 (1 items)
Copyright © 2003-2019 Qdabra Software. All rights reserved.
View our Terms of Use.