Wrox Programmer Forums

Need to download code?

View our list of code downloads.

Register | FAQ | Members List | Calendar | Search | Today's Posts | Mark Forums Read
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 tens of thousands of software programmers and website developers including Wrox book authors and readers. As a guest, you can read any forum posting. By joining today you can post your own programming questions, respond to other developersí questions, and eliminate the ads that are displayed to guests. Registration is fast, simple and absolutely free .
DRM-free e-books 300x50
 
 
Thread Tools Display Modes
  #1 (permalink)  
Old May 12th, 2005, 02:37 AM
Registered User
 
Join Date: May 2005
Location: , , .
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">
    <ItemTemplate>
     <asp:HyperLink id=HyperLink1 runat="server" NavigateUrl='WebForm2.aspx?CategoryID='<%# DataBinder.Eval(Container, "DataItem.CategoryID") %>' Text='<%# DataBinder.Eval(Container, "DataItem.CategoryName") %>'>
     </asp:HyperLink>
    </ItemTemplate>
   </asp:datalist>

But at another page I receive s=null

  if(!Page.IsPostBack)
{
string s=Request.QueryString["CategoryID"];
}

I think the problem is in

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

Thanks


  #2 (permalink)  
Old May 12th, 2005, 03:36 AM
Friend of Wrox
 
Join Date: Apr 2005
Location: Cochin, , India.
Posts: 186
Thanks: 0
Thanked 0 Times in 0 Posts
Default

HI,

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


Prashant


  #3 (permalink)  
Old May 7th, 2011, 01:41 PM
Registered User
 
Join Date: May 2011
Posts: 1
Thanks: 0
Thanked 0 Times in 0 Posts
Default

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


Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are Off
Pingbacks are On
Refbacks are Off

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



All times are GMT -4. The time now is 03:32 PM.


Powered by vBulletin®
Copyright ©2000 - 2017, Jelsoft Enterprises Ltd.
© 2013 John Wiley & Sons, Inc.