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

Home Posts Topics Members FAQ

Problem setting NavigateUrl's in DataList (hyperlink)

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:HyperLin k id=hlLink runat="server"
NavigateUrl='<% #Container.Data Item("CategoryI d")%>'>
<%# Container.DataI tem("CategoryNa me") %>
</asp:HyperLink>& nbsp;
When I try to add it as a querystring it doesn't show up correctly. For
example, if I set NavigateUrl to this:
NavigateUrl='Sh op.aspx?Categor yId=<%#Containe r.DataItem("Cat egoryId")%>'>

The URL address is this:
Shop.aspx?Categ oryId=<%#Contai ner.DataItem("C ategoryId")%>

Any ideas on how to fix this?

Thanks!
Nov 19 '05 #1
3 3408
Figured it out:
NavigateUrl='<% #"Shop.aspx?Cat egoryId=" &
DataBinder.Eval (Container.Data Item, "CategoryId")%> '>
Thanks y'all!

"VB Programmer" <do**@emailme.c om> wrote in message
news:OS******** ******@TK2MSFTN GP09.phx.gbl...
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:HyperLin k id=hlLink runat="server"
NavigateUrl='<% #Container.Data Item("CategoryI d")%>'>
<%# Container.DataI tem("CategoryNa me") %>
</asp:HyperLink>& nbsp;
When I try to add it as a querystring it doesn't show up correctly. For
example, if I set NavigateUrl to this:
NavigateUrl='Sh op.aspx?Categor yId=<%#Containe r.DataItem("Cat egoryId")%>'>

The URL address is this:
Shop.aspx?Categ oryId=<%#Contai ner.DataItem("C ategoryId")%>

Any ideas on how to fix this?

Thanks!

Nov 20 '05 #2
Or like this:

NavigateUrl='<% = DataBinder.Eval (Container.Data Item, "CategoryId ",
"shop.aspx?cate goryId={0}") %>'

"VB Programmer" <do**@emailme.c om> wrote in message
news:OS******** ******@TK2MSFTN GP09.phx.gbl...
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:HyperLin k id=hlLink runat="server"
NavigateUrl='<% #Container.Data Item("CategoryI d")%>'>
<%# Container.DataI tem("CategoryNa me") %>
</asp:HyperLink>& nbsp;
When I try to add it as a querystring it doesn't show up correctly. For
example, if I set NavigateUrl to this:
NavigateUrl='Sh op.aspx?Categor yId=<%#Containe r.DataItem("Cat egoryId")%>'>

The URL address is this:
Shop.aspx?Categ oryId=<%#Contai ner.DataItem("C ategoryId")%>

Any ideas on how to fix this?

Thanks!

Nov 20 '05 #3
Thanks Siva!
"Siva M" <sh******@onlin e.excite.com> wrote in message
news:uy******** ********@TK2MSF TNGP09.phx.gbl. ..
Or like this:

NavigateUrl='<% = DataBinder.Eval (Container.Data Item, "CategoryId ",
"shop.aspx?cate goryId={0}") %>'

"VB Programmer" <do**@emailme.c om> wrote in message
news:OS******** ******@TK2MSFTN GP09.phx.gbl...
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:HyperLin k id=hlLink runat="server"
NavigateUrl='<% #Container.Data Item("CategoryI d")%>'>
<%# Container.DataI tem("CategoryNa me") %>
</asp:HyperLink>& nbsp;
When I try to add it as a querystring it doesn't show up correctly. For
example, if I set NavigateUrl to this:
NavigateUrl='Sh op.aspx?Categor yId=<%#Containe r.DataItem("Cat egoryId")%>'>

The URL address is this:
Shop.aspx?Categ oryId=<%#Contai ner.DataItem("C ategoryId")%>

Any ideas on how to fix this?

Thanks!

Nov 20 '05 #4

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

Similar topics

1
2280
by: New User | last post by:
asp.net framework 1.1, C# I am trying to create thumbnail images dynamically and load them on a web page. When I click on a thumbnail image it opens the large version of it. I use DataList to display the images. All my images are in a folder call ‘CocoaImages”. I have the following code in my DataList template to make data bound and make the thumbnail images clickable. Thumbnail images are created and displayed as expected. When I...
0
1061
by: dfgasner | last post by:
Sry I'm very new to VB.net and am trying to create a shopping cart by way of a book that teaches you VB.net along the way. Unfortunatly I'm stuck cuz I ran into this error and I can't seem to find out what's wrong. If you want to see the error that it's giving me you can go to my site at http://surfnsun.gasner.com. I will also include the script for the page that is giving me problems. Thanks a lot for all the help. This is the...
2
8108
by: John South | last post by:
Hi I'm new to asp.net and c# and I've got stuck on an apparently simple problem: I'm trying to make a HyperLink dynamically visible/invisible. This is the HTML: <asp:HyperLink Runat="server" Text="Back"
5
3049
by: | last post by:
Hi, I'm trying to use the cookie munging session handling behaviour of asp.net instead of cookies themselves as I'm finding quite a few people are barring cookies (especially AOL users). If I change the setting in web.config everything seems to work fine as long as I'm using relative paths. The problem is I've got a menuing system that's generated from a site-wide template - so I use a fixed path from the application root - (ie:...
4
4237
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") %>'
1
1998
by: Nitin | last post by:
I'm using the following code to verify weather the checkbox in the template column of the datalist1 is checked ' Sub Button1_Click(sender As Object, e As EventArgs) cart.text="" Dim i As Integer For i = 0 To productlist.Controls.Count - 1 Dim item As DataListItem = productlist.Controls(i) If item.ItemType = ListItemType.Item Or item.ItemType = ListItemType.AlternatingItem Then Dim cb As System.Web.UI.WebControls.CheckBox =...
2
1464
by: Arsalan | last post by:
Well, suppose i have couple of controls in datalist and one of them is link button control how do i invoke link button controls click method in the datalist ??? Suppose link button control will send info back to server and redirect to another page, how do i do it in datalist ? I have following code in item templatae <asp:LinkButton id="Linkbutton1" OnClick="OnClickMethod"
1
1714
by: Benton | last post by:
Hi there, I have a HyperLink control inside a DataList's ItemTemplate: <asp:DataList ID="lstDatos" runat="server"> <ItemTemplate> <asp:HyperLink ID="lnkName" runat="server" CssClass="Link" Text='<% #Eval("NAME") %>' NavigateUrl="repInTransitByProvider.aspx?id=<% #Eval('ID') %>"> </asp:HyperLink>
4
2328
by: W4yne | last post by:
I have a datalist with the following <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"> </asp:HyperLink> This opens a new page with the URL somepages.aspx?id=7 how do I use this id number
0
10490
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, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
10259
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
10238
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,...
0
10030
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 protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
1
7570
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
5589
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
4145
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
2
3761
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
3
2941
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.