当前位置:编程学习 > C#/ASP.NET >>

关于ASP动态赋控件属性值

   <tr>
              <td>
                <%
                    for (int i = 1; i <= numToForShow; i++)
                    {
                        resultNum = i;

                        if (resultNum % 12 == 0)
                        {
                            %>
                            <br />
                            <%
                        }
                         %> 
                     <asp:HyperLink ID="HyperLink1"  runat="server" NavigateUrl="~/user/Default.aspx"><%=resultNum %></asp:HyperLink>  
                  <%
                    
                    }
                 %>
                </td> 
            </tr>

numToForShow 属性 从数据库查询所有该类型数据总和 经过一系列逻辑处理 变成该循环的条件

目前想法 NavigateUrl的属性值 添加Id=resultNum得值传递给下个页面 NavigateUrl="~/user/Default.aspx?Id=resultNum"
但是Default页面取不出值望高手帮忙 并解释错误原因  先谢过
补充:.NET技术 ,  ASP.NET
CopyRight © 2022 站长资源库 编程知识问答 zzzyk.com All Rights Reserved
部分文章来自网络,