473,811 Members | 3,811 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

How to use id reference from Hyperlink NavigateURL

1 New Member
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 2328
Frinavale
9,735 Recognized Expert Moderator Expert
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.Que ryString property.

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

Cheers!

-Frinny
Oct 16 '07 #2
mikeyeli
63 New Member
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 Recognized Expert Moderator Expert
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
mikeyeli
63 New Member
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
8957
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. I create the navigatURL from database dynamically. I see the same question mentioned here but the response is not souitable for me: http://www.dotnet247.com/247reference/msgs/11/57708.aspx
1
6964
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, the page posts back BEFORE redirecting to the next page. If I change the navigateurl property to go to a page in a subfolder (foo\bar.aspx) it does not do a postback. I swear I'm not messing with it - I did the experiment 3 times in a row ......
0
550
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 images as the ImageURL of the Hyperlink. When a load the page with the controls on it works fine, but sometimes the images are broken, but if i hit refresh i get random selections of the gifs appearing and not appearing. if i hit Back button to a page...
5
6693
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 but here is the snippet of my asp:hyperlink object; <asp:HyperLink NavigateUrl="authonly/clientdetails.aspx?searchID="+<%#DataBinder.Eval(Conta iner.DataItem,"CLIENTREF")%> ID="Hyperlink1"><%#DataBinder.Eval(Container.DataItem,...
2
6771
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 set image width. This problem makes my link clickable only on its borders. When viewing HTML source I could see that spacer.gif has no width and height, so HTML shows only 1px x 1 px image.
4
9360
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 Customer</asp:HyperLink> But when the page runs it shows text only "View Customer" without hyperlink. This is what it was rendered in the page source <a id="hrefView" class="main" style="color:Blue;">View Customer</a>
4
4240
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" runat="server"> <asp:HyperLink id="MyHLink" NavigateUrl='<%# geturl("123456") %>'
4
2220
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" NavigateUrl="javascript:OpenImage('<%# DataBinder.Eval(Container.DataItem,"FileName") %>');"><%#
3
3409
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" NavigateUrl='<%#Container.DataItem("CategoryId")%>'> <%# Container.DataItem("CategoryName") %> </asp:HyperLink>&nbsp;
11
4459
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 parameter with the NavigateURL property. protected void grdTopicArch_DataBinding(object sender, EventArgs e) { HyperLink lnkTopicTitle = (HyperLink)grdTopicArch.FindControl("lnkTopicTitle"); lnkTopicTitle.NavigateUrl =...
0
9724
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, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
10379
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 tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
1
10394
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
1
7665
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 presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
6882
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
5552
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
0
5690
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
2
3863
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
3
3015
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

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.