Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

how to reload javascript page with new values FROM ASP

Status
Not open for further replies.

yogesh

Programmer
Jun 22, 2000
14
0
0
US
how to reload javascript page&nbsp;&nbsp;with&nbsp;&nbsp;new values which are read by an asp so that my page can act accordingly. <br><br>Thank<br>yogesh&nbsp;&nbsp;<br><br><br>&nbsp;<br>
 
eh, you know you could just add that to the end of your already existing post( calling vbscript from javascript ). <br><br>but here is a simple example, which may only work in IE. (the fact that it dynamically changes the Form)<br>you may not need to do it exactly like I did, but take note in how you use a &lt;FORM&gt; tag to post information to an ASP and how the ASP grabs that information.<br><br><FONT FACE=monospace><br>&lt;%@ Language=VBScript %&gt;<br>&lt;HTML&gt;<br>&lt;HEAD&gt;<br>&nbsp;&lt;Title&gt;ActiveX Navigator&lt;/Title&gt;<br>&nbsp;&lt;Script Language=&quot;JavaScript&quot;&gt;<br>&nbsp;&lt;!--<br>&nbsp;function Go(thePath)<br>&nbsp;{<br>&nbsp;&nbsp;DrvFrm.Path.value = thePath;<br>&nbsp;&nbsp;DrvFrm.submit();<br>&nbsp;}<br>&nbsp;--&gt;<br>&nbsp;&lt;/Script&gt;<br>&lt;/HEAD&gt;<br>&lt;BODY&gt;<br>&lt;Form name=&quot;DrvFrm&quot; action=&quot;DriveNav.asp&quot; method=&quot;post&quot; target=&quot;_display&quot;&gt;<br>&nbsp;&lt;input type=&quot;hidden&quot; name=&quot;Path&quot;&gt;<br>&lt;/Form&gt;<br>&lt;%<br>Set fs = Server.CreateObject(&quot;Scripting.FileSystemObject&quot;)<br><br>If not IsEmpty(Request.Form(&quot;Path&quot;)) and Request.Form(&quot;Path&quot;) &lt;&gt; &quot;Root&quot; then<br> Path = Request.Form(&quot;Path&quot;)<br> set Compon = Server.CreateObject(&quot;WsUtil.Componets&quot;)<br> Dim Temp, GetVersion<br> if fs.FolderExists(Path) then<br> Set fsFol = fs.GetFolder(Path)<br> Set fsSub = fsFol.SubFolders<br> Set fsFiles = fsFol.Files<br> <br> %&gt; &lt;Table border=1 width=&quot;100%&quot; align=&quot;center&quot;&gt; <br> &lt;TH bgcolor=Black colspan=8&gt;&lt;Font color=White&gt;&lt;%=Path%&gt;&lt;/FONT&gt;&lt;/TH&gt;<br> &lt;TR bgcolor=Silver&gt;<br> &lt;TD&gt;FileName/Directory&lt;/TD&gt;<br> &lt;TD&gt;Structure Version&lt;/TD&gt;<br> &lt;TD&gt;File Version&lt;/TD&gt;<br> &lt;TD&gt;Product Version&lt;/TD&gt;<br> &lt;TD&gt;File Flags&lt;/TD&gt;<br> &lt;TD&gt;File OS&lt;/TD&gt;<br> &lt;TD&gt;File Type&lt;/TD&gt;<br> &lt;TD&gt;File SubType&lt;/TD&gt;<br> &lt;/TR&gt;<br> &lt;% Response.Write vbcrlf<br> if fsFol.IsRootFolder = False then<br> therpath = replace(fsFol.ParentFolder,&quot;\&quot;, &quot;\\&quot;)<br> %&gt; &lt;TR&gt; &lt;%=vbcrlf & vbtab%&gt;<br> &lt;TD onclick=&quot;Go('&lt;%=therpath%&gt;')&quot; bgcolor=#20b2aa&gt;&lt;IMG SRC=&quot;images/Folder.jpg&quot; width=16 height=16&gt;..&lt;/TD&gt;&lt;%=vbcrlf & vbtab%&gt;<br> &lt;TD&gt; &lt;/TD&gt;&lt;TD&gt; &lt;/TD&gt;&lt;TD&gt; &lt;/TD&gt;&lt;TD&gt; &lt;/TD&gt;&lt;TD&gt; &lt;/TD&gt;&lt;TD&gt; &lt;/TD&gt;&lt;TD&gt; &lt;/TD&gt;&lt;% Response.Write vbcrlf<br> %&gt;&lt;/TR&gt;&lt;% Response.Write vbcrlf<br> else<br> %&gt; &lt;TR&gt; &lt;%=vbcrlf & vbtab%&gt; <br> &lt;TD onclick=&quot;Go('Root')&quot; bgcolor=#20b2aa&gt;&lt;IMG SRC=&quot;images/Folder.jpg&quot; width=16 height=16&gt;..&lt;/TD&gt;&lt;%=vbcrlf & vbtab%&gt;<br> &lt;TD&gt; &lt;/TD&gt;&lt;TD&gt; &lt;/TD&gt;&lt;TD&gt; &lt;/TD&gt;&lt;TD&gt; &lt;/TD&gt;&lt;TD&gt; &lt;/TD&gt;&lt;TD&gt; &lt;/TD&gt;&lt;TD&gt; &lt;/TD&gt;&lt;% Response.Write vbcrlf<br> %&gt;&lt;/TR&gt;&lt;% Response.Write vbcrlf<br> end if<br> For Each fol in fsSub<br> thepath = replace(fol.path,&quot;\&quot;, &quot;\\&quot;)<br> %&gt;&lt;TR&gt;&lt;%=vbcrlf & vbTab%&gt;<br> &lt;TD onclick=&quot;Go('&lt;%=thepath%&gt;')&quot; bgcolor=#20b2aa&gt; &lt;IMG SRC=&quot;images/Folder.jpg&quot; width=16 height=16&gt; &lt;%=fol.name%&gt; &lt;/TD&gt; &lt;%=vbcrlf & vbtab%&gt;<br> &lt;TD&gt; &lt;/TD&gt;&lt;TD&gt; &lt;/TD&gt;&lt;TD&gt; &lt;/TD&gt;&lt;TD&gt; &lt;/TD&gt;&lt;TD&gt; &lt;/TD&gt;&lt;TD&gt; &lt;/TD&gt;&lt;TD&gt; &lt;/TD&gt;&lt;%=vbcrlf%&gt;<br> &lt;/TR&gt;&lt;% Response.Write vbcrlf<br> next<br> For each fsFile in fsFiles<br> ObjectPath = fsFile.path<br> FileExt = fs.GetExtensionName(ObjectPath)<br> If LCase(FileExt) = &quot;dll&quot; or LCase(FileExt) = &quot;ocx&quot; or LCase(FileExt) = &quot;exe&quot; then<br> %&gt; &lt;TR&gt;&nbsp;&nbsp;&lt;%<br> %&gt; &lt;TD bgcolor=#20b2aa&gt; &lt;%=fsFile.name%&gt; &lt;/TD&gt; &lt;%<br> if Compon.VersionInfo(fsFile.path,Temp) then<br> GetVersion = Split(Temp,vbNullChar)<br> for j = LBound(GetVersion) to UBound(GetVersion)<br> %&gt; &lt;TD&gt; &lt;%=GetVersion(j)%&gt; &lt;/TD&gt; &lt;%<br> next<br> else<br> %&gt; &lt;TD&gt; &lt;/TD&gt;&lt;TD&gt; &lt;/TD&gt;&lt;TD&gt; &lt;/TD&gt;&lt;TD&gt; &lt;/TD&gt;&lt;TD&gt; &lt;/TD&gt;&lt;TD&gt; &lt;/TD&gt;&lt;TD&gt; &lt;/TD&gt; &lt;%<br> end if<br> %&gt; &lt;/TR&gt; &lt;%<br> end if<br> next<br> %&gt; &lt;/Table&gt; &lt;%<br> Else<br> %&gt; <br> &lt;Font color=Red size=+2&gt; Path does not exist or is not ready, &lt;BR&gt; press the button to goto the root menu. &lt;/Font&gt;&lt;/BR&gt;<br> &lt;INPUT type=&quot;button&quot; value=&quot;Root Path&quot; id=button1 name=button1 onclick=&quot;Go('Root')&quot;&gt;<br> &lt;%<br> end if<br>else<br> Dim d, dc, s, n<br><br> Set dc = fs.Drives<br> %&gt; <br> &lt;Table border=1 width=&quot;100%&quot; align=&quot;center&quot;&gt; <br> &lt;%=vbcrlf%&gt;<br> &lt;TH bgcolor=Black colspan=2&gt;&lt;Font color=White&gt; Root &lt;/FONT&gt;&lt;/TH&gt;<br> &lt;%<br> Response.Write vbcrlf<br> For Each d in dc<br> %&gt; &lt;TR&gt; &lt;%<br> Response.Write vbcrlf<br> s = d.DriveLetter<br> If d.DriveType = 3 Then<br> n = d.ShareName<br> ElseIf d.IsReady Then<br> n = d.VolumeName<br> End If<br> GoCommand = &quot;Go('&quot; & s & &quot;:\\')&quot;<br> Response.Write vbtab<br> %&gt; &lt;TD onclick=&quot;&lt;%=GoCommand%&gt;&quot;&gt;&lt;%=s%&gt;&lt;/TD&gt;&lt;%<br> %&gt; &lt;TD&gt;&lt;%=n%&gt; &lt;/TD&gt;&lt;%=vbcrlf%&gt; &lt;/TR&gt; &lt;%<br> Response.Write vbcrlf<br> Next<br> %&gt; &lt;/Table&gt; &lt;%<br>end if<br>%&gt;<br><br>&lt;/BODY&gt;<br>&lt;/HTML&gt;<br></font><br><br>you may have to stick it into notepad and indent it a bit to see the flow of the code, wish Tek-tips would take tabs as well.<br><br>Hope this helps. <p>Karl<br><a href=mailto:kb244@kb244.8m.com>kb244@kb244.8m.com</a><br><a href= </a><br>Experienced in , or have messed with : VC++, Borland C++ Builder, VJ++6(starting),VB-Dos, VB1 thru VB6, Delphi 3 pro, Borland C++ 3(DOS), Borland C++ 4.5, HTML,Visual InterDev 6, ASP(WebProgramming), QBasic(least i didnt start with COBOL)
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top