7 Replies - 6023 Views - Last Post: 17 June 2003 - 05:20 PM

#1 Stallion112  Icon User is offline

  • New D.I.C Head

Reputation: 0
  • View blog
  • Posts: 16
  • Joined: 17-June 03

Is There Javascript To Activate Asp.net Controls?

Posted 17 June 2003 - 12:47 PM

Whats up everyone.

I created an icon that when pressed, will open a new window directing the user to another aspx. page (using Javascript). In the new window, I have a text box, and search button that does some code behind work of its own. The search button retrieves a list from the database, and the user selects one of the items in the retrieved data. When they click it, the window will automatically close, and the value of the item they pressed will be put into the textbox on the original screen. This all works fine for me.

Here is what I would like to do, if possible.....

When the user selects the item they want from the pop up window, and after the window closes, is there a way (I'd guess using Javascript) to push a button on the original screen under the pop up window.

So in other words... User clicks icon in window 1. Window 2 pops up. User selects a link in Window 2. Window 2 closes. The value of the link is put into a textbox on Window 1. Then...I want the button next to the textbox on Window 1 to be automatically pressed.

Any suggestions? I'm coding in VB.net.. but I think this would require Javascript.
Any help is appreciated... thank you!

Vt

Is This A Good Question/Topic? 0
  • +

Replies To: Is There Javascript To Activate Asp.net Controls?

#2 gneato  Icon User is offline

  • <title>Untitled Document</title>

Reputation: 0
  • View blog
  • Posts: 1,311
  • Joined: 03-September 01

Re: Is There Javascript To Activate Asp.net Controls?

Posted 17 June 2003 - 01:51 PM

What does the other button (button next to the textbox on Window 1) do?

You can submit forms with javascript...


document.forms.formname.submit();

I believe.
Was This Post Helpful? 0
  • +
  • -

#3 klewlis  Icon User is offline

  • cur tu me vexas?

Reputation: 8
  • View blog
  • Posts: 1,723
  • Joined: 09-November 01

Re: Is There Javascript To Activate Asp.net Controls?

Posted 17 June 2003 - 01:53 PM

yep and then you can pass the values from window 2 to that form as well. but you'd be better off to ask in the javascript forum... :)

welcome to dic.
Was This Post Helpful? 0
  • +
  • -

#4 Stallion112  Icon User is offline

  • New D.I.C Head

Reputation: 0
  • View blog
  • Posts: 16
  • Joined: 17-June 03

Re: Is There Javascript To Activate Asp.net Controls?

Posted 17 June 2003 - 02:09 PM

gneato, on Jun 17 2003, 01:51 PM, said:

What does the other button (button next to the textbox on Window 1) do?

You can submit forms with javascript...


document.forms.formname.submit();

I believe.

The other button (that is on the original page - window 1) takes the value of whatever was put into the textbox, and sends it into a mainframe to return a bunch of values. That work is already done.

The user has the option to click a search icon on window 1 to help them lookup the codes
they need to put into the window 1 textbox. So I set it up so that a new window pops up.
Then the user searches by name.. returning a list of codes they choose from. They click the code in the list, and the code is returned to the window 1 textbox. Then the user must click the code search button to perform the retrieval of information based on the code in the textbox.

I know that the user just has to click a button, how lazy can we be now...!
But still, if there is a way I can somehow push it for them to perform the search that
would be good.

Is there some sort of "window close" script that could push the button?
ie. Window 2 closes, and pushes a button on Window 1.

I will look in javascript forums, but if anyone knows how, I would appreciate your post.
Thank you.
Was This Post Helpful? 0
  • +
  • -

#5 gneato  Icon User is offline

  • <title>Untitled Document</title>

Reputation: 0
  • View blog
  • Posts: 1,311
  • Joined: 03-September 01

Re: Is There Javascript To Activate Asp.net Controls?

Posted 17 June 2003 - 02:24 PM

Well, IE supports these in the body tag:

<body onbeforeunload="dothis();" onunload="dothat();">

Keep in mind that you _do_not_ want to "push" the button for them, you want to carry out the action that the button does when it's pressed.
Was This Post Helpful? 0
  • +
  • -

#6 Stallion112  Icon User is offline

  • New D.I.C Head

Reputation: 0
  • View blog
  • Posts: 16
  • Joined: 17-June 03

Re: Is There Javascript To Activate Asp.net Controls?

Posted 17 June 2003 - 02:34 PM

So then in my case:

The button's ID = VbtnGetVendor

The button's event is: VbtnGetVendor_Click

When Window 2 Closes... I would like the 'VbtnGetVendor_Click' subroutine
of Window 1 to be called. How would I use the script example you gave me
to perform this? Which of the 'Load' properties would I use? Thanks

<body onbeforeunload="'VbtnGetVendor_Click" onunload="'VbtnGetVendor_Click">
Was This Post Helpful? 0
  • +
  • -

#7 gneato  Icon User is offline

  • <title>Untitled Document</title>

Reputation: 0
  • View blog
  • Posts: 1,311
  • Joined: 03-September 01

Re: Is There Javascript To Activate Asp.net Controls?

Posted 17 June 2003 - 05:03 PM

the body attributes can only call javascript commands.
Was This Post Helpful? 0
  • +
  • -

#8 Stallion112  Icon User is offline

  • New D.I.C Head

Reputation: 0
  • View blog
  • Posts: 16
  • Joined: 17-June 03

Re: Is There Javascript To Activate Asp.net Controls?

Posted 17 June 2003 - 05:20 PM

Ok.

So then is there a script that can call my 'VbtnGetVendor_Click' subroutine in my .vb code-behind page?

Thanks.
Was This Post Helpful? 0
  • +
  • -

Page 1 of 1