473,504 Members | 13,830 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Hyperlinks in User Controls (1.1)

I'm migrating code that used to be repeated on several pages to a single
user control. In this control there is a repeater, and when the repeater
is bound, I add some links to it. This all worked great on the page but
now that I have moved the code to a user control (which lives in a
subdirectory in my application: /UserControls), my links which are all
generated as relative links now add that sub directory to the path. So
I'd like a link to point to www.mysite.com/mypage.aspx, but after moving
the code to a control, it now generates as:
www.mysite.com/UserControls/mypage.aspx.
I know I could just do some string manipulation to fix this but I'm
wondering if there is a more elegant way to fix this right. Like a way
to tell the control to generate the relative link correctly even if the
UserControl folder name changed or regardless of whether the application
is running in the root of IIS or within a Virtual directory.
Any ideas? Thanks!

Matt
Jul 7 '08 #1
2 1112
Hi,

Hi if previously you links address like <a herf="somepage.aspx">Link</
a>
now change it to <a herf="../somepage.aspx">...

Best of luck

Munna
-----------
www.munna.shatkotha.com/blog
www.munna.shatkotha.com
www.shatkotha.com
Jul 8 '08 #2
Hi

just add "../" prefix to the url...
Best of luck

------
Munna

www.munna.shatkotha.com/blog
www.munna.shatkotha.com
www.shatkotha.com
Jul 8 '08 #3

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

Similar topics

3
1459
by: Aasp | last post by:
Hello! I'm a complete Javascript newbie and my question is surely very naive, but believe me, I've spent this whole day searching thru the net and didn't find any solution to my little problem....
6
3936
by: Colleyville Alan | last post by:
I have an application that has an Access table that stores the locations of slides in a Powerpoint file. This used to work fine when there were about 4 files and 200 slides. The database would...
5
3758
by: John Warner | last post by:
I have a wierd problem that I can't find any reference to in the knowledge base. I develop simple databases at the company where I work, and many of them are used by hundreds of employees. We all...
0
1295
by: acconrad | last post by:
We're trying to make it such that you can change the color for hyperlinks in RichTextBox controls. Currently VS.NET '03 does not allow one to do this. We tried this -->...
1
2050
by: John | last post by:
Hi all, My app contains a datagrid with hyperlinks inside and these hyperlinks all point back to the same page. The problem is that I have a 'search' user control and the viewstate changes once...
2
1154
by: carlos.cruz | last post by:
Hi, I trying to create dinamicaly hyperlinks, which I manage to do with the following code: Protected Overrides Sub OnPreRender(ByVal e As EventArgs) ctl = New HyperLink ctl.Target =...
9
2957
by: Viken Karaguesian | last post by:
Hello all, I'm making a calendar section in a website. Each month is its own page and navigated by Previous / Next links. I have it working now with standard hyperlinks, but I want to learn how...
1
2359
by: Robin | last post by:
Hello! I'm having trouble with links and hyperlinks in MS Access 2003 - any help would be great! Question 1! The "insert hyperlink" icon opens a browser window, allows the user to browse...
0
1182
by: Elroyskimms | last post by:
I'm updating an existing project to send data between pages using Server.Transfer (HTTPContext) instead of response.redirect and querystring parameters. All of my web user controls inherit from a...
4
1777
by: jonny | last post by:
I would like to add a password and user name to my website. If the username and password is correct than activate the hyperlinks and buttons. Could you please share some code how how to achieve...
0
7213
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
7098
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
7298
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
7366
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
7471
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
5610
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
1
5026
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...
1
754
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
0
406
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence...

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.