Question

J'utilise un répéteur pour certains produits énumérés.

J'essaie de créer un asp: HyperLink NavigateUrl en utilisant du texte codé en dur ainsi que des données XPATH.

NavigateUrl = 'mypage.aspx? ID = <% # XPath (& "; THEID &"))% > & et; name = < ;% # XPath (& Quot; THENAME & Quot;)% & Gt; '

Évidemment, cela ne fonctionne pas.

Est-ce que quelqu'un sait comment faire ce travail?

Était-ce utile?

La solution

Cela devrait fonctionner:

<asp:HyperLink 
    runat="server" 
    NavigateUrl='<%# string.Format("mypage.aspx?ID={0}&name={1}", XPath("THEID"), XPath("THENAME")) %>' 
    Text="some link" 
/>
Licencié sous: CC-BY-SA avec attribution
Non affilié à StackOverflow
scroll top