how to use treeView in ASP page? how m'i going to add item in it?
thanks
Printable View
how to use treeView in ASP page? how m'i going to add item in it?
thanks
IMHO the easiest way to add any activex control onto a HTML page is to use MS FrontPage (insert the activex control from the menu bar) or Visual Interdev 6.0 (similar procedure as in Frontpage).
Those tools will take care of many things: look up the CLSID in the registry and so on. They will create an object tag that you can then modify (CODEBASE....).
how am i going to add node in the treeView?? i mean for the root one....
i wrote it this way but it didn't work...<br%
here is a sample.
I used Interdev to place the treeview inside an html document.
this is an excerpt from my html page
</BODY>
<script language="VBscript">
'sub doit
dim n
set n = document.all.Treeview1.nodes.add
n.Text = "test"
'end sub
</script>
it worked!
thanks lothar..
i tried it out, it works.. but when i try to add child node to it, it doesn't work... is VBscript support child node?
my code is:
dim n
set n = document.all.tvwMain.Nodes.Add (,,"r","root")
set n = document.all.tvwMain.Nodes.Add ("r",tvwChild,"c1", "child 1")
set n = document.all.tvwMain.Nodes.Add ("c1",tvwChild,"c2", "child 2")
I think VBSCript doesn't know the constants that you use (tvwChild). VBScript doesn't have access to the typelib at runtime.
I suggest you look up the value for tvwChild (may be 2 or whatever number) and use that literal value.
ic..thanks
^o^...
does anyone know how to assign a value into treeview imagelist property? does VBscript support imageList property for tree view?
i tried to code it many ways but didn't work...
^o^.. thanks...
IMHO this cannot be done.
The Imagelist property of the treeview is of type "object". You'd need to assign an object instance of an imagelist control. That wouldn't be the problem.
But, how would you add those images to the imagelist?
In VB those images become part of the frx file of your form module and will be compiled into an exe.
This is not the case when you add an activex control to a HTML page.
hai lothar...
if i'm using activeX control in InterDev, do i need to specify the codebase for the control?? as i know, everything will be done for u interdev when u copy the web project rihgt? any mistake in my understanding?
well, Interdev will do some things for you, but I doubt that it will do everything.
I guess it won't know anything about the location of your cab files.
Just check the HTML it produces. If there is not codebase attribute in the object tag, be sure to add ot yourself.
Also make sure, that your cab files are where they belong.
so u mean that interDev wouldn't deploy the .ocx file together with my project to the production server? i have to do it manually... m'i right?
No, Interdev will deploy your OCX, but, that's not everything you need to deploy.
In fact you don't even have to deploy the OCX but you have to create an Internet Package with PDWizrad and deploy the cab file.
This is because in order to run the OCX it has to be installed on the client including all the runtime dlls that are required for the OCX.
All that stuff is contained in the Cab file for the OCX.
Get the Cab for the treeview from the MS site or your VB CD.
and again, don't forget to specify the cab file location in the codebase attribute of your object tag in your html page.
MAy be you should really really read the VB docs concerning deploying internet components.
thanks again lothar... i will...
^o^..