Wrox Programmer Forums
Go Back   Wrox Programmer Forums > ASP.NET and ASP > ASP.NET 1.0 and 1.1 > ASP.NET 1.1
|
ASP.NET 1.1 As of 10/6/2005, this forum is locked as part of the reorganization described here: http://p2p.wrox.com/topic.asp?TOPIC_ID=35394. No posts have been deleted. Open ongoing discussions from the last week have been moved to either ASP.NET 1.0 and 1.1 Beginners http://p2p.wrox.com/asp-net-1-0-1-1-basics-60/ or ASP.NET 1.0 and 1.1 Professional. http://p2p.wrox.com/forum.asp?FORUM_ID=50. See my sticky post inside for more.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the ASP.NET 1.1 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 October 11th, 2004, 03:02 AM
Registered User
 
Join Date: Oct 2004
Posts: 5
Thanks: 0
Thanked 0 Times in 0 Posts
Default Problems passing values to a HyperlinkColumn

Hey guys, I am using BoundColumn and HyperlinkColumns to create a datagrid.

I have two boundColumns that provides me two values.

I am trying to pass those two values to the Hyperlinkcolumn to pass it as a querystring into a model window.

Note: I am doing this programmatically and have no HTML view to add a template.

Code:

 For i = 0 To myDataSet.Tables(0).Columns.Count - 1

                 Dim dgColumn As New BoundColumn

                 Select Case myDataSet.Tables(0).Columns(i).ColumnName

                     Case "id"
                         dgColumn.HeaderText = "Id"
                         dgColumn.DataField = myDataSet.Tables(0).Columns(i).ColumnName
                         dgWorkflow.Columns.Add(dgColumn)

                     Case "name"
                         dgColumn.HeaderText = "Name"
                         dgColumn.DataField = myDataSet.Tables(0).Columns(i).ColumnName
                         dgWorkflow.Columns.Add(dgColumn)

                 End Select
Next

Dim dgHColumn As New HyperlinkColumn
dgHColumn.Text = "View"
dgHColumn.NavigateUrl = "Javascript: alert('value1/value2')

How can i have each value in in row to be passed into the link.

If some one know how to work with iTemplate, may be they can give me a snipet to get me going...

Thanks,

Shrini


 
Old October 12th, 2004, 12:01 AM
Friend of Wrox
 
Join Date: Oct 2003
Posts: 326
Thanks: 0
Thanked 0 Times in 0 Posts
Send a message via ICQ to Santhi Send a message via MSN to Santhi
Default

Here is the code snippet..It may help you

<asp:DataGrid autogenerateColumns=false>
<Columns>
    <asp:TemplateColumn HeaderText="Type" >
    <ItemTemplate>
    <asp:HyperLink Runat="server" ID="Type" text=<%#DataBinder.Eval(Container.DataItem,"Type") %>>
     <%#DataBinder.Eval(Container.DataItem,"Type")%>
 </asp:HyperLink>
</ItemTemplate>
</asp:TemplateColumn>
 <asp:BoundColumn DataField="Participants" HeaderText="Number of Participants"></asp:BoundColumn>
</Columns>
</asp:DataGrid>






Similar Threads
Thread Thread Starter Forum Replies Last Post
Passing value from HyperLinkColumn to UserControl 62vette ASP.NET 1.0 and 1.1 Basics 0 April 19th, 2006 06:16 AM
Passing values from dropdownlist sparc ASP.NET 1.0 and 1.1 Basics 2 October 31st, 2005 09:42 AM





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