Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
HomeAnnouncementsFree MagazinesWhite PapersSubmit Content
Discussion GroupsASP.NETWindows FormsLanguages.NET FrameworkVisual Studio.NET
Articles.NET FrameworkASP.NETToolsWindows Forms
.NET DirectoryOpen Source ProjectsUser GroupsWeb Resources
Related Topics
Visual Basic 6SQL ServerMS AccessOther DB ProductsMS Server ProductsMore Topics ...

.NET Forum / .NET Framework / New Users / December 2006

Tip: Looking for answers? Try searching our database.

Javascript call in Sub Procedure

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
mianiro - 26 Dec 2006 19:28 GMT
Hi everyone

I need a little bit of help ... I need to call a javascript function
inside of a .net sub procedure.  Here is my code:

 ClientScript.RegisterClientScriptBlock(Me.GetType(), "", "<script
language='JavaScript'> function OpenChild() " & _
       "{" & _
       "var ParmA = retvalA.value;" & _
       "var ParmB = retvalB.value;" & _
       "var ParmC = retvalC.value;" & _
       "var MyArgs = new Array(ParmA, ParmB, ParmC);" & _
       "var WinSettings =
""center:yes;resizable:no;dialogHeight:300px""" & _
       "var MyArgs = window.showModalDialog(" & _
       """CompanyInfo.aspx"", MyArgs, WinSettings);" & _
       "if (MyArgs == null)" & _
       "{" & _
       "}" & _
       "else" & _
       "{" & _
       "retvalA.value=MyArgs[0].toString();" & _
       "retvalB.value=MyArgs[1].toString();" & _
       "}" & _
       "} </script>")

Am I going about this the right way? Nothing seems to happen when I hit
this code in the debugger. Is there another way to call javascript from
a sub procedure?
Scott M. - 26 Dec 2006 21:45 GMT
What your code does is send this JavaScript down to the client machine so
that it will be executed on the client-side.  Since it is client-side code,
you can't step through it with the server-side debugger.

> Hi everyone
>
[quoted text clipped - 25 lines]
> this code in the debugger. Is there another way to call javascript from
> a sub procedure?
Alien2_51 - 27 Dec 2006 23:30 GMT
This script just defines the function, I think what you need to do is call
the function.. Declare the function in an include file or inline in the page
and then use something like this to call it...

ClientScript.RegisterClientScriptBlock(Me.GetType(), "", "<script
language='JavaScript'>OpenChild(); </script>")

> Hi everyone
>
[quoted text clipped - 25 lines]
> this code in the debugger. Is there another way to call javascript from
> a sub procedure?
mianiro - 28 Dec 2006 18:40 GMT
Yes .. tried that, but no results. I wish i could step through the
javascript. I dont know if it is my js code or the way i'm calling it.
I think I'm going to try a workaround ...

Thanks for the helpthough

> This script just defines the function, I think what you need to do is call
> the function.. Declare the function in an include file or inline in the page
[quoted text clipped - 32 lines]
> > this code in the debugger. Is there another way to call javascript from
> > a sub procedure?- Hide quoted text -- Show quoted text -

Free Magazines

Get these publications absolutely FREE for up to 12 months. There are no hidden fees and no obligation. Simply choose a title, complete the application form and submit it. Read more ...

Oracle MagazineNetwork ComputingComputer WorldBio-IT WorldeWeekInformation WeekInfosecurity
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.