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

Extracting the current URL from "Design View"

RSH
Hi,

I have a user created control that has quite a bit of codebehind code. I
have one link in the HTML page code that I need to insert the current URL
in. I have tried several scenerios but the URL always comes back with
nothing:

href="EmployerSolutions_Quote.aspx?url=<% Request.Url.ToString %>" Click
here for our
comprehensive Quote...

I need to pass the current URL to the next page so after they fill out the
quote they are returned to the page they came from. Since the control
appears throughout the site it can't be hardcoded.

How do I make that work?

Thanks!
Ron
Sep 22 '06 #1
1 1852
hi Ron,
you could do it that way. but there is always the Url.Referrer property.
note that it gets lost if you do a postback on your
EmployerSolutions_Quote.aspx page. the Referrer is itself after a postback,
if you follow. i use a base page class in most of my projects, which
persists the UrlReferrer across postbacks, so that it isn't necessary to
pass URLs around the site the whole time.

also, it might be no harm to use the explicit full URL:
Request.Url.AbsoluteUri

Request.Url.ToString() seems to give the absolute url anyway, but remember
Request.Url is only an object, and calling .ToString() on an object will
usually just give you the type name of the object.

ahhh, i just noticed, the problem is that you didn't include the = sign in
your <% code blocks.
you should have <%= Request.Url... %>

the way you have it just means that the expression is evaluated, not
outputted to the client.

hope this helps

tim
"RSH" <wa*************@yahoo.comwrote in message
news:e%****************@TK2MSFTNGP04.phx.gbl...
Hi,

I have a user created control that has quite a bit of codebehind code. I
have one link in the HTML page code that I need to insert the current URL
in. I have tried several scenerios but the URL always comes back with
nothing:

href="EmployerSolutions_Quote.aspx?url=<% Request.Url.ToString %>" Click
here for our
comprehensive Quote...

I need to pass the current URL to the next page so after they fill out the
quote they are returned to the page they came from. Since the control
appears throughout the site it can't be hardcoded.

How do I make that work?

Thanks!
Ron

Sep 23 '06 #2

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

Similar topics

36
by: Andrea Griffini | last post by:
I did it. I proposed python as the main language for our next CAD/CAM software because I think that it has all the potential needed for it. I'm not sure yet if the decision will get through, but...
18
by: Lorem Ipsum | last post by:
interesting! I just found a page in which Explorer's View Source does nothing! How did they do that?
1
by: jloxsom | last post by:
Hi all... New user new to VC++. I've used the AppWizard to create an SDI with the CFormclass. The "View" file is a dialog. I want to create a few EditBoxes, associate member variables to...
2
by: Vinod I | last post by:
Hi Team, When I tryed following code, I am getting the Runtime Error as "The View State is invalid for this page and might be corrupted." Exception Details: System.Web.HttpException: The View...
10
by: Wildemar Wildenburger | last post by:
Hi there :) I don't know how else to call what I'm currently implementing: An object that behaves like a list but doesn't store it's own items but rather pulls them from a larger list (if they...
7
by: alessandro menchini | last post by:
Hello, First of all: i apologize for my english...i'm still learning... If i create a view it seems that DB2 manage this view like an updateable view. But I need to create a view "read only",...
48
by: Tony | last post by:
How much bloat does the STL produce? Is it a good design wrt code bloat? Do implementations vary much? Tony
2
by: Phaiz | last post by:
Not sure if you'd need an activex control but I'm looking for a script to change the folder view to "Classic View" within IE. I have an iframe that loads the users My Documents folder and would...
4
by: marcnz | last post by:
Hi, I am working for a company which as a MS SQL backend and Access as front end. We update automatically each access db on the user local machine when a new feature has become available. We...
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
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...
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
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
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...
0
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
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,...

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.