Jump to content
Sign in to follow this  
juniorp

Passar valores entre páginas

Recommended Posts

juniorp

Boa Tarde! Podiam-me dizer como se passa valores de um hyperlinkfield de uma gridview para uma nova página? Tenho isto

<asp:HyperLinkField HeaderText="TOTAL Unitário de:" DataTextField="valor"  NavigateUrl="PagDetalhesUser.aspx" ItemStyle-HorizontalAlign="Center">

mas acho (quase de certeza) que me falta alguma coisa qualquer coisa do tipo

NavigateUrl='<%# "PagDetalhesUser.aspx?valor=" + Eval("valor") %>'

Obrigado desde já.

Share this post


Link to post
Share on other sites
juniorp

Dá como erro

Databinding expressions are only supported on objects that have a DataBinding event.System.Web.UI.WebControls.HyperLinkField does not have a DataBinding event.

Share this post


Link to post
Share on other sites
juniorp

Fico com isto depois de alterado

<asp:HyperLinkField HeaderText="TOTAL Unitário de:" DataTextField="valor"  
                        NavigateUrl='<%# "PagDetalhesUser.aspx?valor=" + Eval("CustomerID").ToString())%>'
                        ItemStyle-HorizontalAlign="Center">

Share this post


Link to post
Share on other sites
juniorp

Sim o erro é explícito :) mas obrigado pela insitênciae pelo conselho bruno1234, mas já está resolvido

Para quem precisar ficou assim

<asp:HyperLinkField HeaderText="TOTAL Unitário de:" DataTextField="valor" DataNavigateUrlFields="valor" DataNavigateUrlFormatString="~\PagDetalhesUser.aspx?valor={0}" ItemStyle-HorizontalAlign="Center">

Obrigado

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
Sign in to follow this  

×
×
  • Create New...

Important Information

By using this site you accept our Terms of Use and Privacy Policy. We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.