473,399 Members | 3,603 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,399 software developers and data experts.

How to use id reference from Hyperlink NavigateURL

1
I have a datalist with the following
Expand|Select|Wrap|Line Numbers
  1. <asp:HyperLink ID="link1" runat="server" Text='<%# Eval ("Name_of_rally") %>' NavigateUrl='<%# String.Format("somePages.aspx?id={0}", Eval("id")) %>' Font-Bold="True" Font-Size="Large">
  2.                 </asp:HyperLink>
  3.  
This opens a new page with the URL somepages.aspx?id=7

how do I use this id number

I would like to open another datalist only showing the data for the record with an id of x
Oct 16 '07 #1
4 2308
Frinavale
9,735 Expert Mod 8TB
I have a datalist with the following
Expand|Select|Wrap|Line Numbers
  1. <asp:HyperLink ID="link1" runat="server" Text='<%# Eval ("Name_of_rally") %>' NavigateUrl='<%# String.Format("somePages.aspx?id={0}", Eval("id")) %>' Font-Bold="True" Font-Size="Large">
  2.                 </asp:HyperLink>
  3.  
This opens a new page with the URL somepages.aspx?id=7

how do I use this id number

I would like to open another datalist only showing the data for the record with an id of x

The "id" variable in your URL is part of something called a QueryString.
You can access the QueryString's Keys and Values using the HttpRequest.QueryString property.

Look into researching how to use the QueryString to achieve what you want.

Cheers!

-Frinny
Oct 16 '07 #2
you can try the following Code( c# ):

Expand|Select|Wrap|Line Numbers
  1.  
  2. string _id;
  3.  
  4. if(this.Request.Params["id"] != null)
  5. {
  6.        _id = this.Request.Params["id"].ToString();
  7. }
  8.  
Oct 16 '07 #3
Frinavale
9,735 Expert Mod 8TB
you can try the following Code( c# ):

Expand|Select|Wrap|Line Numbers
  1.  
  2. string _id;
  3.  
  4. if(this.Request.Params["id"] != null)
  5. {
  6.        _id = this.Request.Params["id"].ToString();
  7. }
  8.  
Hehe, I don't know why I didn't mention Request.Params as well.
Thanks Mikeyeli :)
Oct 16 '07 #4
Hehe, I don't know why I didn't mention Request.Params as well.
Thanks Mikeyeli :)
No Prob! glad i could help!
Oct 16 '07 #5

Sign in to post your reply or Sign up for a free account.

Similar topics

4
by: Amir Eshterayeh | last post by:
Dear Friends My asp hyperlink goes to relative address instead of absolute. I like navigate url goes to outsite link like www.asp.net but now, it goes to www.mysite/www.asp.net please help....
1
by: Mark | last post by:
Ok this is very odd. I have a hyperlink server control (not a linkbutton) on my .aspx page. When the navigateurl property is set to a file (blah.aspx) in the same directory as the current page,...
0
by: Ryan Harvey | last post by:
Hi all, I have written a web user control that contains a repeater control. the ItemTemplate for this control is basically 6 Hyperlinks in a row, that are dynamically allocated one of 7 gif...
5
by: Martin Dew | last post by:
Having some problems getting a hyperlink object to work in my repeater control, It displays the text I have asked it to for the hyperlink, but it does not act as a link. My repeater code is below...
2
by: Robson Carvalho Machado | last post by:
Dear friends, I'm dynamically creating a Hyperlink with spacer.gif as ImageURL that is an 1px transparent image only to determine link position, but as I create this link dynamically I could not...
4
by: Lan H. Nguyen | last post by:
I have this line of code in my .aspx page <asp:HyperLink ID="hrefView" CssClass="main" ForeColor="blue" Runat="server" NavigateUrl='<%# "View.aspx?id=" + ID.ToString()%>'>View...
4
by: Tomek R. | last post by:
Hello ! This post does'nt regard column hyperlink. I just have single hyperlink and want to create it's NavigateUrl dynamically. This is my test page <form id="Form1" method="post"...
4
by: Satya | last post by:
Hi all, The following code is throwing a run time error "The server tag is not well formed. " <ItemTemplate> <asp:HyperLink Runat="server" ID="lnkFile"...
3
by: VB Programmer | last post by:
I have a datalist with a hyperlink in the Item Template. When I set the NavigateUrl simply to this, the databound CategoryId shows up fine: <asp:HyperLink id=hlLink runat="server"...
11
JustRun
by: JustRun | last post by:
Hi, I'm developing a gridview its datasource is SqlDataSource. one of the Grid item is asp:Hyperlink ID = "lnkTopicTitle", I wanna deal with this Hyperlink from the C# code behind to send a...
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: 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?
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
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
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,...
0
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...

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.