更新时间:2023-02-16 15:37:46
尝试如下...< asp:LinkButton ID =LinkButtonViewrunat =serverPostBackUrl =〜/ Web_Pages / Details?PropertyId =+'<%#Bind(PropertyId)%>'> View< / asp:LinkButton>
调整必要时引用。
如果Tadit解决方案不起作用,试试这个..< asp:linkbutton id = LinkButtonView runat = server postbackurl = <% #Eval( PropertyId , 〜/ Web_Pages / Details?PropertyId = {0})%> an> > 查看< / asp:linkbutton >
用<%#Bind替换Bind(PropertyId) (PropertyId)%>并检查...
希望,您的问题将得到解决..
Hi, can you please help me to solve this problem. I am trying to pass the id of a row in a gridview to another page, but I am having this error, could you please help me. The concept is that when I click to view the details of a particular row, it should redirect to another page, by having the id of the row that I will use to fetch the data in database. Here is the code. Thank you
<asp:TemplateField>
<ItemTemplate>
<asp:LinkButton ID="LinkButtonView" runat="server" PostBackUrl='<%# "~/Web_Pages/Details?PropertyId="+ Bind("PropertyId") %>'>View</asp:LinkButton>
</ItemTemplate>
</asp:TemplateField>
Try like below...<asp:LinkButton ID="LinkButtonView" runat="server" PostBackUrl="~/Web_Pages/Details?PropertyId=" + '<%# Bind("PropertyId") %>'>View</asp:LinkButton>
Adjust the quotes if necessary.
if Tadit solution doesn't works, try this..<asp:linkbutton id="LinkButtonView" runat="server" postbackurl=" <%# Eval("PropertyId", "~/Web_Pages/Details?PropertyId={0}") %>" >View</asp:linkbutton>
Replace Bind("PropertyId") with <%# Bind("PropertyId") %> and check...
Hope, your problem will be Resolved..