方法一 :
代码
<asp:TemplateField HeaderText=”报告月份” SortExpression=”month”>
<ItemTemplate>
<a href=# onclick=’javascript:window.open(“Project_Report_ViewDetail.aspx?month=<%# Eval(“month”) %>&projectid=<%# Eval(“projectid“) %>&Report=TR”,null,”heigt=500,width=800,toolbar=no,menubar=no,location=no”);’ ><%# Eval(“month“) %></a>
</ItemTemplate>
</asp:TemplateField>
<ItemTemplate>
<a href=# onclick=’javascript:window.open(“Project_Report_ViewDetail.aspx?month=<%# Eval(“month”) %>&projectid=<%# Eval(“projectid“) %>&Report=TR”,null,”heigt=500,width=800,toolbar=no,menubar=no,location=no”);’ ><%# Eval(“month“) %></a>
</ItemTemplate>
</asp:TemplateField>
方法二:
代码
<script type= "text/javascript ">
function show(taskid)
{
window.open ( 'AddTask.aspx?id= '+taskid, 'newwindow ', 'height=300, width=400,top=200, left=200 ,toolbar=no, menubar=no, scrollbars=no ')
}
</script>
<ItemTemplate>
<a href= "# " onclick= 'show( <%#DataBinder.Eval(Container.DataItem, "TaskID ") %> ); '> <asp:label id= "labelSumary " runat= "server " Text= ' <% #Bind( "TaskSummary ")%> '> </asp:label> </a>
</ItemTemplate>
function show(taskid)
{
window.open ( 'AddTask.aspx?id= '+taskid, 'newwindow ', 'height=300, width=400,top=200, left=200 ,toolbar=no, menubar=no, scrollbars=no ')
}
</script>
<ItemTemplate>
<a href= "# " onclick= 'show( <%#DataBinder.Eval(Container.DataItem, "TaskID ") %> ); '> <asp:label id= "labelSumary " runat= "server " Text= ' <% #Bind( "TaskSummary ")%> '> </asp:label> </a>
</ItemTemplate>