0

I have a situation where I need to call a path relative to the current url pretty straight forward, however for some reason when I make the execute the url part of the current url gets lost and I do not know why.

In other words I am currently a this webpage.

localhost:<port>/X/View/12345 

and in my html I have a basic anchor tag:

<a class="btn btn-link w-full" href="Export"><i class="fa fa-file-excel-o pull-left"></i><span class="pull-right">Export</span></a> 

I would think that when I click the link the browser would go:

localhost:<port>/X/View/12345/Export 

However I end up with:

localhost:<port>/X/View/Export 

I was hoping someone could give some points at what to look at, or why this could be happening?

Note:

  • I cannot update my link to say href="12345/Export".
  • There also doesn't appear to be a base path set on the page.
  • The RequestUrl is localhost:<port>/X/View/12345

I can't seem to work out why I am loosing the id part of the url? :(

1
  • is Export a file or directory? Commented Apr 7, 2017 at 2:18

1 Answer 1

1

Since there is no slash after 12345 it's considered by your browser a file not the directory

In localhost:/X/View/12345
to go to localhost:/X/View/12345/Export

Relative url has to be

<a class="btn btn-link w-full" href="12345/Export"><i class="fa fa-file-excel-o pull-left"></i><span class="pull-right">Export</span></a> 

either that or you have to do a url rewrite or redirect for /X/View/12345 to be /X/View/12345/

Sign up to request clarification or add additional context in comments.

1 Comment

Hey figure that :) Thanks

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.