Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Calling a VB.NET function from JavaScript

Status
Not open for further replies.

cjdrake

Programmer
Jul 11, 2003
30
0
0
GB
Calling a VB.NET function from JavaScript

Is this possible?

I need to re-populate the controls of a parent window, when a child window is closed. I planned to do this by simply calling my PopulateControls() method in the parent's code behind, but am beginning to believe this is not possible?

If so, is there a workaround?
Thanks.
 
You'd be right, it's not possible. You'd have to reload the page to get vb.net to execute. If you need to load things on the parent page that are dependent on what the user selected in the popup, you can pass a parameter in the url.
Code:
opener.location.href="parentPage.aspx?popupParam=" + document.formName.fieldName.value

Adam
while(ignorance){perpetuate(violence,fear,hatred);life=life-1};
 
Thanks adam. That's a useful suggestion. It might be a little more complicated than that as the page is part of a multipage wizard and the control I want to populate is actually a datagrid.....

Will keep working on it.

Thanks again.
 
In short, you can't call server-side functions from the client, but you CAN manipulate parameters/fields and trigger PostBacks/ wire client events to trigger Server Control's event handlers (via Page.GetPostBackEventReference).

[COLOR=blue gainsboro]
Get a FREE iPod by helping me get mine! Click my referrer link:

More about the company and deal:
[/color]
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top