Solved

Datagrid hyperlink with multiple parameters

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

How to run any project with ease

Manage projects of all sizes how you want. Great for personal to-do lists, project milestones, team priorities and launch plans.
- Combine task lists, docs, spreadsheets, and chat in one
- View and edit from mobile/offline
- Cut down on emails

Join & Write a Comment

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…
Illustrator's Shape Builder tool will let you combine shapes visually and interactively. This video shows the Mac version, but the tool works the same way in Windows. To follow along with this video, you can draw your own shapes or download the file…
This video shows how to remove a single email address from the Outlook 2010 Auto Suggestion memory. NOTE: For Outlook 2016 and 2013 perform the exact same steps. Open a new email: Click the New email button in Outlook. Start typing the address: …

747 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

Need Help in Real-Time?

Connect with top rated Experts

13 Experts available now in Live!

Get 1:1 Help Now