How can I call a Javascript function from my VB.net code?
How can I call a Javascript function from my VB.net code?
How can I call a Javascript function from my VB.net code?
How can I call a Javascript function from my VB.net code?
How can I call a Javascript function from my VB.net code?
How can I call a Javascript function from my VB.net code? How can I call a Javascript function from my VB.net code? How can I call a Javascript function from my VB.net code? How can I call a Javascript function from my VB.net code? How can I call a Javascript function from my VB.net code? How can I call a Javascript function from my VB.net code? How can I call a Javascript function from my VB.net code? How can I call a Javascript function from my VB.net code?
How can I call a Javascript function from my VB.net code? How can I call a Javascript function from my VB.net code?
How can I call a Javascript function from my VB.net code?
Go Back  Xtreme Visual Basic Talk > > > How can I call a Javascript function from my VB.net code?


Reply
 
Thread Tools Display Modes
  #1  
Old 06-27-2011, 01:28 PM
garethmann garethmann is offline
Centurion
 
Join Date: Jul 2003
Location: Fort Lauderdale, Florida
Posts: 105
Default How can I call a Javascript function from my VB.net code?


I have built an ASP.Net website in VS2005. It is one of those set-ups where you have 2 seperate files for the default page: i.e. Default.aspx and Default.apsx.vb.

I need to be able to call a JavaScript function from within my VB code, also I need to pass a string variable into the JavaScript function. The JavaScript code is currently sitting at the top of the Default.aspx page whereas the VB code is in the Default.apsx.vb page.


Additional info (if it helps):

What the VB code does is take a user-inputed address and find it in an access database and returns certain info about the address. I am trying to improve it to display a Google Map of the address using the Google Maps JavaScript API.

I already have the javascript function ready to go that takes a string address and makes and displays a google map of it, I just need to be able to call it after the user has entered their address.
__________________
"Any sufficiently advanced technology is indistinguishable from magic."
Arthur C. Clarke
Reply With Quote
  #2  
Old 06-28-2011, 07:27 AM
garethmann garethmann is offline
Centurion
 
Join Date: Jul 2003
Location: Fort Lauderdale, Florida
Posts: 105
Default

Actually I have been thinking about this some more and it seems that the most sensible way to do it is to do the reverse. I.e. to pass the address to the webpage and have the javascript function pick up the address and run everytime the webpage is refreshed.

So in other words, each time the user enters an address, that address would be stored in a hidden textbox or a cookie or something, then when the page is refreshed the javascript function grabs the address from the hidden textbox/cookie and runs it.

But what would the JavaScript syntax be to retrieve the address from the hidden textbox or cookie? Something like "getElementbyID("Name of text box")"???
__________________
"Any sufficiently advanced technology is indistinguishable from magic."
Arthur C. Clarke
Reply With Quote
  #3  
Old 06-28-2011, 08:26 AM
DrPunk's Avatar
DrPunkHow can I call a Javascript function from my VB.net code? DrPunk is offline
Senior Contributor

* Expert *
 
Join Date: Apr 2003
Location: Never where I want to be
Posts: 1,403
Default

MSDN article on using javascript with ASP.NET -> http://msdn.microsoft.com/en-us/library/aa479390.aspx
__________________
There are no computers in heaven!
Reply With Quote
Reply


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off

Forum Jump

Advertisement:





Free Publications
The ASP.NET 2.0 Anthology
101 Essential Tips, Tricks & Hacks - Free 156 Page Preview. Learn the most practical features and best approaches for ASP.NET.
subscribe
Programmers Heaven C# School Book -Free 338 Page eBook
The Programmers Heaven C# School book covers the .NET framework and the C# language.
subscribe
Build Your Own ASP.NET 3.5 Web Site Using C# & VB, 3rd Edition - Free 219 Page Preview!
This comprehensive step-by-step guide will help get your database-driven ASP.NET web site up and running in no time..
subscribe
How can I call a Javascript function from my VB.net code?
How can I call a Javascript function from my VB.net code?
How can I call a Javascript function from my VB.net code? How can I call a Javascript function from my VB.net code?
How can I call a Javascript function from my VB.net code?
How can I call a Javascript function from my VB.net code?
How can I call a Javascript function from my VB.net code? How can I call a Javascript function from my VB.net code? How can I call a Javascript function from my VB.net code? How can I call a Javascript function from my VB.net code? How can I call a Javascript function from my VB.net code? How can I call a Javascript function from my VB.net code? How can I call a Javascript function from my VB.net code?
How can I call a Javascript function from my VB.net code?
How can I call a Javascript function from my VB.net code?
 
How can I call a Javascript function from my VB.net code?
How can I call a Javascript function from my VB.net code?
 
-->