Click here to Skip to main content
15,895,799 members
Home / Discussions / C#
   

C#

 
QuestionBasic Auth in ASP.NET? Pin
Adrian Hall13-Mar-03 19:13
Adrian Hall13-Mar-03 19:13 
Generalabout 'new form' Pin
cg112013-Mar-03 17:50
cg112013-Mar-03 17:50 
GeneralRe: about 'new form' Pin
Danny Blanchard14-Mar-03 8:33
Danny Blanchard14-Mar-03 8:33 
GeneralCompiling Entire ASP.NET C# Web Application from CommandLine csc.exe Pin
Vasudevan Deepak Kumar13-Mar-03 17:40
Vasudevan Deepak Kumar13-Mar-03 17:40 
GeneralUpdating a database Pin
Baatezu_Not_Home13-Mar-03 14:46
sussBaatezu_Not_Home13-Mar-03 14:46 
GeneralRe: Updating a database Pin
Mazdak14-Mar-03 5:34
Mazdak14-Mar-03 5:34 
QuestionJavascript communication with System.Form? Pin
Bog13-Mar-03 10:45
Bog13-Mar-03 10:45 
AnswerRe: Javascript communication with System.Form? Pin
King Rufus13-Mar-03 11:14
King Rufus13-Mar-03 11:14 
You will need to define three interfaces. IDocHostUIHandler, ICustomDoc and an interface that will define methods you will reference through your JavaScript.

Your form will inherit the IDocHostUIHandler interface as well as the interface your define. Take a look on google for example on how to do this. If you have problems please drop me an email and I can send you some code.

Catch the NavigateComplete2 event that will be fired after loading a web page in your browser control. You can cast the 'sender' argument to an object of type ICustomDoc and then call SetUIHandler. Pass the 'this' pointer to the method call.

Once you've done all of this you should be able to make calls into your form from your JavaScript. Of course these calls can't be made until after you have made the call to SetUIHandler. (ie. If your Javascript is catching some event that occurs before you get the NavigateComplete2 event then it won't work.

BTW: Your JavaScript should look something like this:

window.external.AMethodInYourCustomInterface(<some args="" might="" go="" here="">)

Hope this helps and wasn't too confusing.
Smile | :)
GeneralRe: Javascript communication with System.Form? Pin
Bog13-Mar-03 12:00
Bog13-Mar-03 12:00 
Generalalso Pin
Bog13-Mar-03 12:19
Bog13-Mar-03 12:19 
GeneralRe: also Pin
King Rufus14-Mar-03 16:08
King Rufus14-Mar-03 16:08 
GeneralRe: also Pin
Bog17-Mar-03 17:41
Bog17-Mar-03 17:41 
GeneralRe: also Pin
King Rufus17-Mar-03 19:22
King Rufus17-Mar-03 19:22 
GeneralRe: also Pin
LongRange.Shooter28-Mar-03 4:32
LongRange.Shooter28-Mar-03 4:32 
AnswerRe: Javascript communication with System.Form? Pin
LongRange.Shooter9-Apr-03 10:04
LongRange.Shooter9-Apr-03 10:04 
GeneralXP Style buttons Pin
Sovman13-Mar-03 10:39
Sovman13-Mar-03 10:39 
GeneralRe: XP Style buttons Pin
Poolbeer14-Mar-03 2:26
Poolbeer14-Mar-03 2:26 
GeneralRe: XP Style buttons Pin
Sovman14-Mar-03 5:51
Sovman14-Mar-03 5:51 
GeneralSelect Boxes or Inverse Color Pens Pin
Anonymous13-Mar-03 10:14
Anonymous13-Mar-03 10:14 
GeneralRe: Select Boxes or Inverse Color Pens Pin
Chris Jobson13-Mar-03 11:14
Chris Jobson13-Mar-03 11:14 
GeneralModeless Dialogs Pin
Jeff J13-Mar-03 8:05
Jeff J13-Mar-03 8:05 
GeneralRe: Modeless Dialogs Pin
Chris Jobson13-Mar-03 10:56
Chris Jobson13-Mar-03 10:56 
GeneralRe: Modeless Dialogs Pin
James T. Johnson13-Mar-03 11:19
James T. Johnson13-Mar-03 11:19 
GeneralRe: Modeless Dialogs Pin
Jeff J13-Mar-03 11:58
Jeff J13-Mar-03 11:58 
GeneralRe: Modeless Dialogs Pin
Jeff J13-Mar-03 11:56
Jeff J13-Mar-03 11:56 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.