日期:2014-05-17  浏览次数:20496 次

GridView的链接参数问题??
GridView的链接参数中可以加表中字段的数据,如果加入页面其他控件,如DropDownList中选择值的数据到链接参数中怎么加?????
------最佳解决方案--------------------
把<%#Eval("字段名")%>改成

<%=DropDownList1.SelectedValue%>

<%#DropDownList1.SelectedValue%>
都可以。
------其他解决方案--------------------
XXXX.aspx?id=document.getelementbyid('下拉框id').value
------其他解决方案--------------------
引用:
解决方法,转换成模板
<asp:TemplateField>
   <ItemTemplate>
     <a href="DepartmentSelfConstructF.aspx?ID=<%# DataBinder.Eval(Container.DataItem,"ID")%>&amp;UID=<%=DropDownList3.SelectedValue%>"……


同意
------其他解决方案--------------------
<asp:HyperLinkField DataNavigateUrlFields="ID" 
DataNavigateUrlFormatString="F.aspx?DSCID={0}&UID=<%=DropDownList3.SelectValue%>" Text="详细" />

运行后DSCID的值正常,UID的值显示的是<%=DropDownList3.SelectValue%>"??
------其他解决方案--------------------
解决方法,转换成模板
<asp:TemplateField>
   <ItemTemplate>
     <a href="DepartmentSelfConstructF.aspx?ID=<%# DataBinder.Eval(Container.DataItem,"ID")%>&UID=<%=DropDownList3.SelectedValue%>">详细</a> 
   </ItemTemplate>
</asp:TemplateField>