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

URI for pages on the site

I'm developing a Web App using C#. I want a page in the app to refer to
another page in the app. I tried to create a web request with the page
address below:

pageAddress = "http://~/clientDBQuery.aspx";
WebRequest request = WebRequest.Create (pageAddress);

and got the following error:

Exception Details: System.UriFormatException: Invalid URI: The hostname
could not be parsed.

What is the syntax for referring to a page on the current site so I don't
have to change it when it's published?
When I used the following page address:

pageAddress = "http://clientDBQuery.aspx";

I didn't get the parsing error but the debugger didn't stop on a break point
I set in the LoadPage method. This seems to occurr because it goes to a page
on my ISP which doesn't exist.

What's the right way to handle this situation?

Thanks, Neil
Mar 24 '08 #1
0 1115

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

Similar topics

10
by: Kenny Ashton | last post by:
Hi all Can anyone tell me the best way to set permissions to allow an ASP program to write new Html pages to my site's root folder, without chancing users also being able to write to the root....
3
by: Lyle Fairfield | last post by:
In a recent thread there has been discussion about Data Access Pages. It has been suggested that they are not permitted on many or most secure sites. Perhaps, that it is so, although I know of no...
5
by: Samba | last post by:
Hi, I've a web application and I'm using Forms authentication. My app contains some pages that can be viewed by everyone and it doesn't require any authentication or authoization and these pages...
3
by: dave | last post by:
I need to add additional .aspx pages to an existing web site. I was hoping to create a new web project in VS 2003, build the project, copy the .aspx files and the .dll into the virtual directory...
6
by: Joseph Geretz | last post by:
I have the following class which I am serializing and passing back and forth between my Web Service application and the client. public class Token : SoapHeader { public string SID; public...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
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: 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: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
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
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
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
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
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.