473,325 Members | 2,671 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,325 software developers and data experts.

Links in user control

I have application CPO.
I have user control with links which is included in all my pages.
But my pages are in different directories.

<TR>
<TD><%=funkcije.createUrl(path& "/advertisments.aspx",
"Advertisments",0)%></TD>
</TR>

Now I would like to set the path.
For example if the page is in the directory Admin then the link should be:

<TR>
<TD><%=funkcije.createUrl(./advertisments.aspx",
"Advertisments",0)%></TD>
</TR>

If the page is in default directory, the link should be:

<TR>
<TD><%=funkcije.createUrl(Admin/advertisments.aspx",
"Advertisments",0)%></TD>
</TR>

What about if the page is in other directory, for example User direcory?
How can I set the link to advertisments.aspx?
Set the absolute link?

<TR>

<TD><%=funkcije.createUrl("http://localhost/cpo/Admin/advertisments.aspx",
"Advertisments",0)%></TD>
</TR>

How can I solve this problem. No matter where my user control is, that I
have the right link?

My function is in other dll and definition is:

Function createUrl(ByVal link As String, ByVal name As String, Optional
ByVal stev As Int16 = 0, Optional ByVal cl As Int16 = 0, Optional ByVal
description As String = "") As String

Dim clas As String
If stev = 0 Then
clas = "class='main'"
ElseIf stev = 1 Then
clas = "class='clas1'"
End If

If cl = 0 Then
createUrl = "<a " & clas & " title='" & description & "' href="
& Chr(34) & link & Chr(34) & ">" & name & "</a>"
ElseIf cl = 1 Then
createUrl = "<a " & clas & " title='" & description & "' href="
& Chr(34) & "javascript:void(0)" & Chr(34) & " onclick=" &
Chr(34) & link & Chr(34) & ">" & name & "</a>"
else
createUrl = "<a " & clas & " title='" & description & "' href="
& Chr(34) & "javascript:" & link & Chr(34) & ">" & name &
"</a>"
End If

End Function

Thank you,
Simon
Nov 18 '05 #1
0 838

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

0
by: Cameron Laird | last post by:
QOTW: "Really, of course, the only things you need to make explicit are the ones that readers don't understand." -- Steve Holden "Working with unicode objects in Python is so transparent, it's...
18
by: Jan Tuxen | last post by:
Jakob Nielsen in his most recent Alertbox (http://www.useit.com/alertbox/20040503.html) tells web authors to change the color of visited links. I agree to his purpose: Help users understand...
3
by: Ernesto Morin | last post by:
Not sure if somebody can help me here. Our company develops a web based system that lets client have interaction with it. One of the things that we have is the ability for a user to create links...
1
by: Phil Lamey | last post by:
Hi All, I am trying to build a user control that is used on each page of my site. The user control contains a datalist of links. The list of links (and associated information) is grabbed from...
3
by: Andy Dingley | last post by:
We've all seen this structure many times: <ul> <li><a href="..." >Click here</a></li> <li><a href="..." >Click here</a></li> </ul> Now it's obvious good practice to have sensible link texts,...
2
by: Mats-Lennart Hansson | last post by:
Hi, I want to dynamically add links into a richtextbox control. However, I actually don't want to go to a web page, I just want to catch the linkclick event and do something else. This works...
12
by: Alan Silver | last post by:
Hello, I Classic ASP, I used to have a standard way of making the top-level site navigation links. I had an include file which included a Sub like this ... Sub MakeLink(TocURL, TocText) If...
1
by: Andre Ranieri | last post by:
I have a quick question - I'd just like to have confirmation to be sure. I'm building an ASP.NET corporate site for my employer, some of the pages have e-commerce capability and will need to be...
2
by: rn5a | last post by:
In a shopping cart app, assume that a user has placed 4 orders (each order has a corresponding OrderID which will be unique). When he comes to MyCart.aspx, by default, the details of his last order...
0
by: DolphinDB | last post by:
Tired of spending countless mintues downsampling your data? Look no further! In this article, you’ll learn how to efficiently downsample 6.48 billion high-frequency records to 61 million...
0
by: ryjfgjl | last post by:
ExcelToDatabase: batch import excel into database automatically...
0
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
1
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: Vimpel783 | last post by:
Hello! Guys, I found this code on the Internet, but I need to modify it a little. It works well, the problem is this: Data is sent from only one cell, in this case B5, but it is necessary that data...
0
by: jfyes | last post by:
As a hardware engineer, after seeing that CEIWEI recently released a new tool for Modbus RTU Over TCP/UDP filtering and monitoring, I actively went to its official website to take a look. It turned...
0
by: ArrayDB | last post by:
The error message I've encountered is; ERROR:root:Error generating model response: exception: access violation writing 0x0000000000005140, which seems to be indicative of an access violation...
1
by: Defcon1945 | last post by:
I'm trying to learn Python using Pycharm but import shutil doesn't work
1
by: Shællîpôpï 09 | last post by:
If u are using a keypad phone, how do u turn on JavaScript, to access features like WhatsApp, Facebook, Instagram....

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.