我做的是一个德育网站,首页导航栏是动态的,导航栏用的是datalist绑定数据库, -数据库表如下--
 
 SortID2
3
5
7
9
10
SortName
首页
德育新闻
心理健康
教育摄影
精美文章
道德法制
Url
main.aspx
news.aspx
news.aspx
news.aspx
news.aspx
news.aspx网页导航栏上能出现数据表中的内容,但是连接到new.aspx上时,出现如下显示http://localhost/WebApplication1/news.aspx?SortID=3          SortID的值是可以变动的;
在news.aspx后面编写代码如下
public class news : System.Web.UI.Page
{

private void Page_Load(object sender, System.EventArgs e)

      string SortID=Convert.ToString (Request.QueryString.Get ("sortID"));
 
Response.Write (SortID);
                    }
                       .........
          }
    
    
    
    在首页html代码中的datalist代码如下<asp:datalist id=DataList1 DataKeyField="SortID" Height="8px" BorderWidth="0px" BorderStyle="Dotted" BackColor="Lime" RepeatDirection="Horizontal" runat="server">
<SelectedItemStyle BorderColor="Red"></SelectedItemStyle>
<ItemTemplate>
&nbsp;|&nbsp;<A href='news.aspx?SortID=<%#DataBinder.Eval(Container.DataItem,"SortID")%>' >
<%# DataBinder.Eval(Container.DataItem,"SortName")%>
</A>
</ItemTemplate>
</asp:datalist>
问题是在news.aspx页面中用Response.Write (SortID);无法接收到SortID的值
请那位大哥帮帮忙 ,小弟再次谢过了