Solved

Datagrid hyperlink with multiple parameters

Posted on 2004-10-20
4
400 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

Does Powershell have you tied up in knots?

Managing Active Directory does not always have to be complicated.  If you are spending more time trying instead of doing, then it's time to look at something else. For nearly 20 years, AD admins around the world have used one tool for day-to-day AD management: Hyena. Discover why

Question has a verified solution.

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

Suggested Solutions

I recently decide that I needed a way to make my pages scream on the net.   While searching around how I can accomplish this I stumbled across a great article that stated "minimize the server requests." I got to thinking, hey, I use more than one…
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…
This video shows how to quickly and easily add an email signature for all users on Exchange 2016. The resulting signature is applied on a server level by Exchange Online. The email signature template has been downloaded from: www.mail-signatures…
Nobody understands Phishing better than an anti-spam company. That’s why we are providing Phishing Awareness Training to our customers. According to a report by Verizon, only 3% of targeted users report malicious emails to management. With compan…

825 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