I’m using ObjectForScripting property to interact with web page inside WebBrowser control and everything works fine except I can’t figure out how to pass array of strings back to C#
HTML code
<input type="submit" onclick="window.external.save(Array('test', 'test2'))" />
Form
// Returns System.__ComObject
public void Save(object parameters)
{
}
// Throws an exception
public void Save(object[] parameters)
{
}
// Also throws an exception
public void Save(string[] parameters)
{
}
Rather than fight it; maybe approach the problem from another angle… could you (instead, either of):
Array.join) and pass a single string, and split it (string.Split) in the C#Save(string s)), then call a final method to actually commit the changes