473,386 Members | 1,644 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,386 software developers and data experts.

User Control Root

This is making me mental: For some reason I can't get the virtual
application root directly in a control.
This doesn't work:
<asp:HyperLink ID="HyperLink1" Target="_parent" NavigateUrl="~/
page.aspx" runat="server">click here</asp:HyperLink>

it gives http://www.contoso.com/page.aspx
While it should give http://www.contoso.com/MyApplication/page.aspx

Now when I set the navigateURL in de Page_Load of the control, like
below, it does work:
HyperLink1.NavigateUrl = ResolveUrl("~/page.aspx");
gives: http://www.contoso.com/MyApplication/page.aspx

Now, I have about 30 controls with countless images. Is there an
easier way to get the virtual application root, then setting it all
individually in the Page_Load Event?

thanks in advance,
Willem

Mar 16 '07 #1
0 800

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

Similar topics

3
by: eastcoastguyz | last post by:
On an Apache server, I want to be able to have a user name/password directory. I know this can be done with .htaccess, but I want to be able to do this for multiple users. The purpose of this, is...
4
by: patrick_a | last post by:
Hello, I am trying to insert multiple instances of a custom user control into a placeholder on an aspx page, based on the records retrieved from the database. I use the datareader to loop through...
2
by: Stephen | last post by:
I need some help with this. I have two files page.aspx: A page that a user calls uc.ascx: A user control that page.aspx uses. The ascx file has HTML used for a site background which would...
2
by: Jeremy | last post by:
Everything in my app worked fine - then I moved some user controls to a subfolder named \ControlTemplates that physically exists directly under the site root. Then, at runtime when these lines...
2
by: Alex | last post by:
Hi. I need some help on this. I have a user control (a header) in my root directory, and all my pages use that control. Then a created a folder (in my root directory) and put a new page inside it,...
4
by: Marty U. | last post by:
I have a Session variable I need to check the value of. If it is value a then redirect to some page. I need to implement this in a user control that is on all the relevent pages. I placed the if...
2
by: ALI-R | last post by:
Hi I've created a bunch user comtrols for the footer,header,navigation bar of a webpage ,I have two problems: 1) All the controls are in the folder "Control" of the root and all the images...
1
by: Guadala Harry | last post by:
I have a user control that I'm inserting into multiple pages. Part of the HTML content in the user control is a path to an image: <img src="../images/arrow.gif" width="11" height="8" border="0">...
3
by: jonathan.beckett | last post by:
I have been experimenting with placing user controls (using Windows Forms controls) into an ASP.NET webpage - and am completely stuck. I can get a blank user control to work, but nothing beyond...
1
by: gnewsgroup | last post by:
I have a user control called Footer.ascx, in which a background image is inserted like so: <div id="footerdiv" style="background-image:url('Images/ mybackground.jpg');...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
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
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
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...

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.