ASP.NET - Clicking link button dynamically and posting values from databse to a servlet

Asked By Priya on 17-Jan-13 07:30 AM
Hi,
I have a requirement wherein on clicking a button on aspx page, it should open a website having .jsp page which has a link on it. The link button should be dynamically clicked which will take me to a servlet which has some texbox and radiobutton fields on it. These fields should get filled with the values from my database.
In short: On click of a button the servlet should be opened with values filled in the texboxes.
How is this possible in .net? (I am working on C#.Net)
Kindly help.
Robbe Morris replied to Priya on 17-Jan-13 10:14 AM
JavaScript

var mywindow = window.open('some url');

mywindow.document.getElementById('textbox id').value = 'blah';

You may need to use something like wiindow.setTimeout() prior to executing the code to wait for the load of the child window in all browsers.  IE doesn't support certain events in this scenario.  JQuery might be an option for you.

This is actually much easier to do if the child window could "pull" the data from the parent window instead.  You'd use the window.opener object in JavaScript in the child window to get a reference to document objects in the parent window.

This old article shows some examples of doing this sort of thing:

http://www.eggheadcafe.com/articles/20030627a.asp