Solved

Datagrid hyperlink with multiple parameters

Posted on 2004-10-20
4
401 Views
Last Modified: 2010-05-18
I have a datagrid in which I need a hyperlink column that links to another aspx page, with another datagrid. My problem is that the detail information in the dataset on the second page is related to the first dataset by two fields. More specifically, my database is dealing with roof areas of different schools. The areas have labels (A, A1, A2, B, B1, etc.), and so the detail page needs to pull all the data for a certain roof area for the specific school. Everywhere I have seen, you can only pass one "parameter" (DataNavigateUrlField) to the linked page. Is there a way to pass two values for the DataNavigateUrlField?

Thanks in advance for any help.

Christy
0
Comment
Question by:ccbailey
  • 2
  • 2
4 Comments
 
LVL 20

Accepted Solution

by:
jitganguly earned 250 total points
ID: 12358822
:-)
Even I couldn' find out when I had this problem, same boat brother (?)

Anyway, Teh solution is to use templatecolumn

Do it like this

<asp:templatecolumn headertext="Daily">
<itemtemplate>
<asp:HyperLink Runat="server" Target=_blank NavigateUrl='<%#"DetailPnl.aspx?option=Daily&Product_Type="+DataBinder.Eval(Container.DataItem, "Product Type")+"&mydate="+DataBinder.Eval(Container.DataItem, "currentdate")%>'>
<%#DataBinder.Eval(Container.DataItem, "Daily","{0:N2}")%>
</asp:HyperLink>
</itemtemplate>
</asp:templatecolumn>

See NavigateUrl



0
 

Author Comment

by:ccbailey
ID: 12360428
Thanks for your help.  I have the following code for this template column, and it creates a column labeled "Nomenclature Detail", however there are no links in the column - it is blank.  Can you see what I missed?

<asp:templatecolumn headertext="Nomenclature Detail">
        <itemtemplate>
          <asp:HyperLink Runat="server" Target=_blank NavigateUrl='<%#"NomenclatureReportResult.aspx?FacilityValue="+DataBinder.Eval(Container.DataItem, "FacilityID")+"&SectionValue="+DataBinder.Eval(Container.DataItem, "SectionID")%>'>
          </asp:HyperLink>
        </itemtemplate>
       </asp:templatecolumn>

Thanks,
Christy

0
 
LVL 20

Expert Comment

by:jitganguly
ID: 12360527
Try this
You have to ptu somethign inside hyperlink tag. I put FacilityID

<asp:templatecolumn headertext="Nomenclature Detail">
        <itemtemplate>
          <asp:HyperLink Runat="server" Target=_blank NavigateUrl='<%#"NomenclatureReportResult.aspx?FacilityValue="+DataBinder.Eval(Container.DataItem, "FacilityID")+"&SectionValue="+DataBinder.Eval(Container.DataItem, "SectionID")%>'>
<%#DataBinder.Eval(Container.DataItem, "FacilityID")%>
          </asp:HyperLink>
        </itemtemplate>
       </asp:templatecolumn>
0
 

Author Comment

by:ccbailey
ID: 12360675
Perfect - that is exactly what I needed!

Thanks so much!

Christy
0

Featured Post

Announcing the Most Valuable Experts of 2016

MVEs are more concerned with the satisfaction of those they help than with the considerable points they can earn. They are the types of people you feel privileged to call colleagues. Join us in honoring this amazing group of Experts.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Title # Comments Views Activity
If condition on Html with Asp 11 40
Button function on table is in trouble 3 35
MS SQL + date 6 42
Getting robots.txt Error 9 22
I would like to start this tip/trick by saying Thank You, to all who said that this could not be done, as it forced me to make sure that it could be accomplished. :) To start, I want to make sure everyone understands the importance of utilizing p…
I was asked about the differences between classic ASP and ASP.NET, so let me put them down here, for reference: Let's make the introductions... Classic ASP was launched by Microsoft in 1998 and dynamically generate web pages upon user interact…
Are you ready to implement Active Directory best practices without reading 300+ pages? You're in luck. In this webinar hosted by Skyport Systems, you gain insight into Microsoft's latest comprehensive guide, with tips on the best and easiest way…

749 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question