问题
I have a List of Names wrapped in a LinkButton like this
<asp:LinkButton CssClass="link_nombre_paciente_espera" runat="server" PostBackUrl="Default.aspx?id=<%#Eval('id')%>" Text=' <%#Eval("name") %>' ID="name" />
But it doesnt work. When i click on it in the url appears:
Default.aspx?id=<%#Eval('id')%>
How can i fix that??
回答1:
<asp:LinkButton PostBackUrl="Default.aspx?id=<%#Eval('id')%>" Text='<%#Eval("name")%>' />
There was typo. It was just PostBackUr.
回答2:
Try swapping the double quotes like you have for the text
'Default.aspx?id=<%#Eval("id")%>'
instead of
"Default.aspx?id=<%#Eval('id')%>"
来源:https://stackoverflow.com/questions/15112118/asp-link-with-a-querystring-value