Wrox Programmer Forums
ASP.NET 1.x and 2.0 Application Design Application design with ASP.NET 1.0, 1.1, and 2.0.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the ASP.NET 1.x and 2.0 Application Design section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
Old May 12th, 2005, 01:37 AM
Registered User
Join Date: May 2005
Posts: 2
Thanks: 0
Thanked 0 Times in 0 Posts
Default DataList with HyperLink

Hi everybody. Help me,please with the next problem:

I have a Datalist on one page with HyperLinks in it. When I press a hyperlink (CategoryName) I want corresponding CategoryID transfer to another page. Here is the code:

<form id="Form1" method="post" runat="server">
   <asp:datalist id="DataList1" style="Z-INDEX: 101; LEFT: 40px; POSITION: absolute; TOP: 64px" runat="server" Width="96px">
     <asp:HyperLink id=HyperLink1 runat="server" NavigateUrl='WebForm2.aspx?CategoryID='<%# DataBinder.Eval(Container, "DataItem.CategoryID") %>' Text='<%# DataBinder.Eval(Container, "DataItem.CategoryName") %>'>

But at another page I receive s=null

string s=Request.QueryString["CategoryID"];

I think the problem is in

NavigateUrl='WebForm2.aspx?CategoryID='<%# DataBinder.Eval(Container, "DataItem.CategoryID") %>'


Old May 12th, 2005, 02:36 AM
Friend of Wrox
Join Date: Apr 2005
Posts: 186
Thanks: 0
Thanked 0 Times in 0 Posts


I feel 'WebForm2.aspx?CategoryID=' <- this qoute should be removed


Old May 7th, 2011, 12:41 PM
Registered User
Join Date: May 2011
Posts: 1
Thanks: 0
Thanked 0 Times in 0 Posts

<asp:HyperLink id=HyperLink1 runat="server" NavigateUrl=<%# 'WebForm2.aspx?CategoryID=' & DataBinder.Eval(Container, "DataItem.CategoryID") %>' Text='<%# DataBinder.Eval(Container, "DataItem.CategoryName") %>'>

Similar Threads
Thread Thread Starter Forum Replies Last Post
Datalist inside datalist amit.jagtap ASP.NET 2.0 Professional 1 September 4th, 2007 05:03 AM
hyperlink kritimehrotra Excel VBA 3 July 24th, 2006 08:32 PM
hyperlink in nested datalist debjanib ASP.NET 1.0 and 1.1 Professional 3 June 5th, 2006 02:17 PM
hyperlink in nested datalist calling a repeater debjanib C# 1 May 25th, 2006 08:17 AM
Hyperlink CW Classic ASP Databases 5 September 17th, 2003 06:45 AM

Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.