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

Put current page path into hyperlink?

I have a page with a hyperlink (actually in a datalist). I want the
URL to do a postback essentially. I tried to use Page.Request in
the NavigateUrl, but it's always empty? How do I tell it to use the
current page url for the url?

<asp:DataList id="dlstItems" runat="server" OnItemCommand="OnItemCommand"
SelectedIndex="0">
<ItemTemplate>
<asp:HyperLink NavigateUrl="<%# Request.Path %>" Runat="server">
MyLinkText</asp:HyperLink>
</ItemTemplate>
..
..
..
Nov 18 '05 #1
1 2791
use an <asp:linkbutton> for that if you are trying to get a postback, it'll
set all that postback stuff up for you automatically, but still render it as
a hyperlink. You can also take advantage of the commandname/commandargument
properties so the postback'd page knows what to do.
"Amil" <am********@hotmail.com> wrote in message
news:%2***************@TK2MSFTNGP11.phx.gbl...
I have a page with a hyperlink (actually in a datalist). I want the
URL to do a postback essentially. I tried to use Page.Request in
the NavigateUrl, but it's always empty? How do I tell it to use the
current page url for the url?

<asp:DataList id="dlstItems" runat="server" OnItemCommand="OnItemCommand"
SelectedIndex="0">
<ItemTemplate>
<asp:HyperLink NavigateUrl="<%# Request.Path %>" Runat="server">
MyLinkText</asp:HyperLink>
</ItemTemplate>
.
.
.

Nov 18 '05 #2

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

Similar topics

8
by: Dan | last post by:
When a user clicks on a link in my menu, I want the background color of the link that comes up in the hover to remain on the destination page. My menu looks like this: <div id="adminmenu"> <a...
4
by: Sandy Bremmer | last post by:
I am wondering if the following can be accomplished with javascript (and if so, if you think javascript is an appropriate solution). I'm afraid my javascript skills lack. I need to build a...
9
by: Daniel Walzenbach | last post by:
Hi I am faced with the following problem: I have a page (let’s call this page page1.aspx) containing some TextBoxes and a hyperlink which opens another page (let’s call this page page2.aspx)...
15
by: SFX | last post by:
If I have a session ID (string) can I somehow obtain the session object associated to that ID (it exist of course) ? I know this sounds wicked but I have a situation in which I have to make a...
4
by: zdrakec | last post by:
Hello all: I have a detail page from which the user clicks a hyperlink to get a list page. On the list page, I have included a hyperlink whose NavigateURL property is set, at run time, to be the...
17
by: =?Utf-8?B?Y2F0aGFyaW51cyB2YW4gZGVyIHdlcmY=?= | last post by:
Hello, I have build a website with approximately 30 html-pages. When I search this website in Google, I see the index.html or home.html on this website, but also other html-pages on this...
6
by: titan.nyquist | last post by:
The WebBrowser control won't load a css file written in the same directory as the program. If I put an absolute path to it, it will load it. Thus, the current directory of the WebBrowser control...
11
by: greg | last post by:
Hi all, Is there a way to get the current theme name at design time? I'm trying to write a custom control for which I need to use images from the current theme. I have asigned a theme to the...
2
by: ismailc | last post by:
Hi, I need help please. I have a page with a stylesheet that is read from an aspx form. On the form I have an hyperlink object - which iIwant the Targeturl to open within the current frame where...
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 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 former...
0
by: ryjfgjl | last post by:
In our work, we often need to import Excel data into databases (such as MySQL, SQL Server, Oracle) for data analysis and processing. Usually, we use database tools like Navicat or the Excel import...
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: 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
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:
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...

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.