?
Solved

Datagrid hyperlink with multiple parameters

Posted on 2004-10-20
4
Medium Priority
?
404 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 2
  • 2
4 Comments
 
LVL 20

Accepted Solution

by:
jitganguly earned 1000 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

What does it mean to be "Always On"?

Is your cloud always on? With an Always On cloud you won't have to worry about downtime for maintenance or software application code updates, ensuring that your bottom line isn't affected.

Question has a verified solution.

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

I have helped a lot of people on EE with their coding sources and have enjoyed near about every minute of it. Sometimes it can get a little tedious but it is always a challenge and the one thing that I always say is:   The Exchange of informatio…
This demonstration started out as a follow up to some recently posted questions on the subject of logging in: http://www.experts-exchange.com/Programming/Languages/Scripting/JavaScript/Q_28634665.html and http://www.experts-exchange.com/Programming/…
If you’ve ever visited a web page and noticed a cool font that you really liked the look of, but couldn’t figure out which font it was so that you could use it for your own work, then this video is for you! In this Micro Tutorial, you'll learn yo…
Have you created a query with information for a calendar? ... and then, abra-cadabra, the calendar is done?! I am going to show you how to make that happen. Visualize your data!  ... really see it To use the code to create a calendar from a q…

765 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