English 中文(简体)
在协会的GridView中建造一个超链接。 NET Webform - Eval not working
原标题:Build a HyperLink in a GridView in ASP.NET webforms - Eval not working

我有一份电网概览,有一个有超链接的模板领域:

<asp:TemplateField ItemStyle-Width="12%" HeaderText="VER" HeaderStyle-HorizontalAlign="Center" SortExpression="Ver" ItemStyle-HorizontalAlign="Center">
    <ItemTemplate>  
       <asp:HyperLink ID="HyperLink1" NavigateUrl="~/Admin/Teste/Teste.aspx?rac=<%#Eval( idApontamento )%>" runat="server">TEXT</asp:HyperLink>
    </ItemTemplate> 
</asp:TemplateField>

我现在宣读<代码>。 服务器标签尚未形成。

我应该做些什么,以便在超级链接中直接建造一个问题?

最佳回答

建设你的超文本链接:

<asp:HyperLinkField HeaderText="Title"
  DataTextField="Some Text"
  DataNavigateUrlFields="idApontamento,CustomerID" 
  DataNavigateUrlFormatString="~/Admin/Teste/Teste.aspx?rac={0}&CustomerID={1}" />

保留在<代码>上添加限定值 Url Fields property, and signup the DataNavigateUrlFormatString asserstring. 格式

问题回答

我不认为你可以这样作的话,你必须拿出所有案文或所有具有约束力的表述。

很感激的是,你能够用具有约束力的表述来阐述。 类似情况:

纳维吉特·乌拉尔=及尔特;%# String.Concat(“......”~/Admin/《试验/试验......aspx?rac=”, Eval(“idApontamento”) %>

页: 1 是否取消这种帮助?





相关问题
Anyone feel like passing it forward?

I m the only developer in my company, and am getting along well as an autodidact, but I know I m missing out on the education one gets from working with and having code reviewed by more senior devs. ...

How to Add script codes before the </body> tag ASP.NET

Heres the problem, In Masterpage, the google analytics code were pasted before the end of body tag. In ASPX page, I need to generate a script (google addItem tracker) using codebehind ClientScript ...

Transaction handling with TransactionScope

I am implementing Transaction using TransactionScope with the help this MSDN article http://msdn.microsoft.com/en-us/library/system.transactions.transactionscope.aspx I just want to confirm that is ...

System.Web.Mvc.Controller Initialize

i have the following base controller... public class BaseController : Controller { protected override void Initialize(System.Web.Routing.RequestContext requestContext) { if (...

Microsoft.Contracts namespace

For what it is necessary Microsoft.Contracts namespace in asp.net? I mean, in what cases I could write using Microsoft.Contracts;?

Separator line in ASP.NET

I d like to add a simple separator line in an aspx web form. Does anyone know how? It sounds easy enough, but still I can t manage to find how to do it.. 10x!