![]() |
| ||
| transfer data from an asp .net page into a javasscript script Hello, I am new at this forum. I am trying to figure out how, if possible at all, to transfer data from an asp .net page into a javascript script in an HTML page. |
| ||
| Re: transfer data from an asp .net page into a javasscript script string script = "<script type=\"text\\javascript\">function(){alert('some data');};</script>";That's an easy way. There are many others like AJAX google for that. |
| ||
| Re: transfer data from an asp .net page into a javasscript script Thanks hollystyles, I tried the code and did not work. It seems that this code works when the script and the data are in the same page. I have the script in an html page different to the asp page. |
| ||
| Re: transfer data from an asp .net page into a javasscript script There is more than one way to register the script. Maybe RegisterStartupScript may work better as it waits till the page is fully loaded in the browser before firing. Also I had my slash the wrong way around in the "text/javascript" attribute of the script tags. HTML Page: [HTML]<html> <head> <script type="text/javascript"> function myFunction(data) { alert(data); } </script> </head> <body> </body> </html>[/HTML] ASP.NET page string data = "Hello!"; |
| All times are GMT -4. The time now is 6:02 am. |
Forum system based on vBulletin Copyright ©2000 - 2009, Jelsoft Enterprises Ltd.
©2003 - 2009 DaniWeb® LLC