By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
459,730 Members | 1,524 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 459,730 IT Pros & Developers. It's quick & easy.

Treeview linking to wrong directory

100+
P: 293
Hi All,

In an attached the shot - Exple.jpg



Expand|Select|Wrap|Line Numbers
  1. Node1 is referred to default1.aspx
  2. Node1.1 is referred to Folder1/default11.aspx
  3. Node1.1.1 is referred to Folder1/default111.aspx
On mouse-Hover of the Node 1.1.1, the status bar shows http://localhost/Folder1/Folder1/default111.aspx Please note that the Node 1.1 is clicked prior to the Node 1.1.1.

Could anyone help me to understand technical reason behind why this is happening?
Attached Images
File Type: jpg Exple.jpg (5.3 KB, 237 views)
Sep 1 '12 #1
Share this Question
Share on Google+
23 Replies


100+
P: 293
Anyone, Guesses/thesis please.
Sep 2 '12 #2

acoder
Expert Mod 15k+
P: 16,027
Without code, it'd be difficult to say.

The problem isn't clear either. What do you expect to see?
Sep 10 '12 #3

100+
P: 293
Hi,

Thank you for the reply.

Actually, Node 1.1.1 points to Folder1/default111.aspx page.
Wondering, the click to Node 1.1.1. is trying to find the page at Folder1/Folder1/default111.aspx which results into an error, page not found.

How to get rid of this error?

Thanks.
Sep 10 '12 #4

acoder
Expert Mod 15k+
P: 16,027
You need to link to the page "default111.aspx" without the folder name. Not sure what this has to do with JavaScript.
Sep 17 '12 #5

100+
P: 293
A part of nutshell, this is the tree view built via java script.
Sep 29 '12 #6

100+
P: 293
@acoder,

Thank you for the reply.
Even accosting the link to the page name w/o the folder path, doesn't solve the problem.

Anyone, Guesses/thesis please.

Thank you.
Oct 10 '12 #7

Rabbit
Expert Mod 10K+
P: 12,430
As was said before, it's hard to tell what's wrong without seeing the code.
Oct 10 '12 #8

100+
P: 293
Hi All,

Please guide to solve an incorrect linking problem.

Please find the attached the script.

Below is the Script tag in the page where the above jScript gets called.

Expand|Select|Wrap|Line Numbers
  1. <script type="text/javascript">
  2.  
  3.         d = new dTree('d');
  4.  
  5.         d.add(0,-1,'Example');
  6.         d.add(1,0,'Node 1','Default1.aspx');
  7.         d.add(3,1,'Node 1.1','Folder1/Default11.aspx');
  8.         d.add(5,3,'Node 1.1.1','Folder1/Default111.aspx');
  9.         document.write(d);
  10.  
  11.  
  12. </script>
  13.  
Please provide insights on why it's linking to the wrong directory.
Attached Files
File Type: txt Script.txt (11.8 KB, 481 views)
Jan 29 '13 #9

Rabbit
Expert Mod 10K+
P: 12,430
What directory is it supposed to link to? What is it linking to instead?
Jan 29 '13 #10

100+
P: 293
Hi,

Thank you for the reply.

Once the leaf node of the tree is reached,all directories above in the hierarchy gets repeatedly routed to some non-usual path.

For e.g., as explained in the first post

Node1 refers to default1.aspx
Node1.1 refers to Folder1/default11.aspx
Node1.1.1 refers to Folder1/default111.aspx

On mouse-Hover of the Node 1.1.1, the status bar shows http://localhost/Folder1/Folder1/default111.aspx Please note that the Node 1.1 is clicked prior to the Node 1.1.1.

Ideally, as node 1.1.1 refers to folder1/default111.aspx the status bar should point to the path folder1/default111.aspx
Jan 30 '13 #11

Rabbit
Expert Mod 10K+
P: 12,430
So you're saying the first time you click on each one, it works correctly?
Jan 30 '13 #12

100+
P: 293
No, Actually Not.

That time too the user couldn't route to the correct path, if the user tries to navigate to the node by expanding the '+' without clicking the node.

Provide technical insights behind, please.
Jan 31 '13 #13

Rabbit
Expert Mod 10K+
P: 12,430
What's most likely happening is that your base folder is already http://localhost/Folder1/
Jan 31 '13 #14

100+
P: 293
Seems hard to infer.

Can that be routed dynamically... As per the user's requirement,if I understood your reply correctly.

If not pls correct me.
Feb 1 '13 #15

Rabbit
Expert Mod 10K+
P: 12,430
There's no need to route the links. Just fix the links so they refer to the correct location.
Feb 1 '13 #16

100+
P: 293
The script - put in the post earlier - at every page refers to points to the specific path only.

Releasing nodes randomly, I guess, causes routing.
Feb 2 '13 #17

Rabbit
Expert Mod 10K+
P: 12,430
The paths in your code don't look like "specific" paths. They look like relative paths.
Feb 2 '13 #18

100+
P: 293
Actually, They are specific path only; as per my understanding the path input to the javascript only lags at the './' which refer to the current app folder path.I tried that too, it works the same way.

Just for information ,relative path is perplexing the problem than ever thought possible.

Any technical insights.
Feb 3 '13 #19

Rabbit
Expert Mod 10K+
P: 12,430
The reason your paths are relative is because the paths in your code does not start with http://
Feb 4 '13 #20

100+
P: 293
I thought, probably that could be the reason but not.Still the cursor is pointing to another path than the specific path for the node.

Please provide technical help.
Feb 4 '13 #21

Rabbit
Expert Mod 10K+
P: 12,430
Post your current code. It sounds like you've modified it.

EDIT
I mocked up your code on my system, I have no problem with it. I maintain that the issue you're having is that your relative paths are wrong and you need to write your paths assuming that Folder1 is already your base folder.
Feb 4 '13 #22

100+
P: 293
Hi,

There are some changes in the code but that doesn't link anything to the technical issue posted here.

Just for information,the code behind edits are relevant to functionality of one of the page's content page.This can be inferred to the point that there are no more edits in the script script.js.

Could you pls help me to understand how you tried to mock up the technical issue posted.
Feb 6 '13 #23

Rabbit
Expert Mod 10K+
P: 12,430
I mocked it up by copying your code and setting up the directory structure. I had no issues with the code.

Again, I maintain the stance that the issue is the same thing I've been saying all along. Fix the path references and your code should work fine.
Feb 6 '13 #24

Post your reply

Sign in to post your reply or Sign up for a free account.