Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > ASP .Net > Links in user control

Reply
Thread Tools

Links in user control

 
 
simon
Guest
Posts: n/a
 
      05-12-2004
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


 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
User Control to Control Other User Control Jonathan Wood ASP .Net 4 02-02-2010 03:41 PM
persisting changes to a control outside a user control from the user control? Mad Scientist Jr ASP .Net 0 03-22-2006 08:02 AM
Databinding in a user control that contains another user control StraussGuy@hotpop.com ASP .Net 0 01-07-2005 04:55 PM
Event not firing for user control inside user control vatech1993 ASP .Net 4 12-11-2004 02:51 PM
Manipulating a User Control from another User Control Tom Rowton ASP .Net 2 08-01-2003 08:18 PM



Advertisments
 



1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57