locked
Get multiple parameters from window.external.notify()

    Question

  • Hi everyone!

    I am using the ScriptNotify event to get 3 values from a webpage:

    private void webview_ScriptNotify(object sender, NotifyEventArgs e)
            {
                text1.Text = e.Value;
                text2.Text = e.Value;            
            }

    and here is my method in javascript: window.external.notify(value1,value2)

    How can i use an array in this case so that text1 and text2 will not take tha same value? Thank you in advance!

    Tuesday, March 25, 2014 11:51 PM

Answers

  • Hi George,

    Sorry, only one string parameter can be returned, see the remark section of ScriptNotify event.

    A hosted HTML page can fire the ScriptNotify event in your Windows Store app when the page calls window.external.notify and passes a string parameter.

    However you can always use JavaScript build a string which contains some values, for instance "value1,value2,value3" and then use some C# code to read information.

    --James


    <THE CONTENT IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY KIND, WHETHER EXPRESS OR IMPLIED>
    Thanks
    MSDN Community Support

    Please remember to "Mark as Answer" the responses that resolved your issue. It is a common way to recognize those who have helped you, and makes it easier for other visitors to find the resolution later.

    Wednesday, March 26, 2014 9:15 AM
    Moderator

All replies

  • Hi George,

    Sorry, only one string parameter can be returned, see the remark section of ScriptNotify event.

    A hosted HTML page can fire the ScriptNotify event in your Windows Store app when the page calls window.external.notify and passes a string parameter.

    However you can always use JavaScript build a string which contains some values, for instance "value1,value2,value3" and then use some C# code to read information.

    --James


    <THE CONTENT IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY KIND, WHETHER EXPRESS OR IMPLIED>
    Thanks
    MSDN Community Support

    Please remember to "Mark as Answer" the responses that resolved your issue. It is a common way to recognize those who have helped you, and makes it easier for other visitors to find the resolution later.

    Wednesday, March 26, 2014 9:15 AM
    Moderator
  • Thank you very much!
    Wednesday, March 26, 2014 11:32 PM