当前上下文中不存在名称“Bind” [英] The name 'Bind' does not exist in the current context
本文介绍了当前上下文中不存在名称“Bind”的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
< asp:TemplateField >
< ItemTemplate >
< asp:LinkButton ID = LinkButtonView runat = server < span class =code-attribute> PostBackUrl =' <%# 〜/ Web_Pages / Details?PropertyId = + Bind( PropertyId)%> ' > 查看< / asp:LinkButton >
< / ItemTemplate > ;
< / asp:TemplateField >
解决方案
尝试如下...
< 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})%> > 查看< / 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..
这篇关于当前上下文中不存在名称“Bind”的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文