473,657 Members | 2,513 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 1116
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
1465
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. So it goes: I don't know how to set the style (bold, italic, underlined) to all hyperlinks on a page. I know how to get one like this, but I mean all of them by default, I mean I downloaded a Javascript script from the net, a simple search...
6
3952
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 open all four PPT files at once, and would loop through queriers for ever client and create custom presentations. Now there are 8 files, nearly 500 slides and the computer is bogging down with trying to open them all at once. I know that Access...
5
3773
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 have the same basic computers with the same base image. The problem is, whenever I create a hyperlink object in the database, I'm able to click on it from my PC and it works just fine. All other users click on it and Access just sits there...
0
1306
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 --> http://pluralsight.com/wiki/default.aspx/Craig/RichTextBox2.html and it did not work at all. Does anyone know of any RELIABLE programs/code that allow one to edit RichTextBox controls in C# Windows applications (NOT ASP.NET), including editing the color of hyperlinks?...
1
2052
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 the hyperlink has been clicked, causing the Page_Load event of my user control to fire (which is what I don't want). Is there any way to structure the hyperlink such that the viewstate of my other user controls on the page do not change? If so,...
2
1159
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 = "_blank" ctl.ID = "hl"
9
2966
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 to use Link Rel and Link Rev commands to do the navigation. At the W3C website it shows how to use the Link Rel and Link Rev in the <head> section:
1
2369
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 to the desired file and paste the hyperlink on the form (which obviously remains for on all the records). I am trying to create a
0
1188
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 custom base class so I'd like to modify that base class to capture all <a href=... HTML tags before rendering. I want to modify the value of the href attribute to run a javascript function on the page. The javascript function will parse the...
4
1786
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 this? I have several buttons and links on my home page and do not want it to be active until the user enters the correct password. Using ASP.NET with Visual Studio 2005.
0
8325
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 effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
8844
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, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
8742
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 tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
1
8518
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
1
6177
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 presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
5643
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
4173
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
0
4330
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
2743
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system

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.