0
假設我有以下超鏈接asp.net變化語言
http://localhost:7621/PDWv1.0.4/ProductList.aspx?categoryID=2
而且頁面加載ProductList.aspx的子頁面如下(爲的Page_Load部分)
if (!Page.IsPostBack)
{
l_categoryParseId = Request.QueryString["categoryID"];
if (l_categoryParseId == null || l_categoryParseId.Trim() == null ||
l_categoryParseId == "" || l_categoryParseId.Trim() == "")
{
l_productlist = l_access.getProductList(-1, lang);
}
else
{
int categoryID = Int32.Parse(l_categoryParseId.ToString());
l_productlist = l_access.getProductList(categoryID, lang);
}
for (int i = 0; i < l_productlist.Rows.Count; i++)
{
String path = "http://www.newrising.com.hk";
String httpPath = path + l_productlist.Rows[i]["productPhoto"].ToString();
l_productlist.Rows[i]["productPhoto"] = httpPath;
}
listViewProductList.DataSource = l_productlist;
listViewProductList.DataBind();
// GridViewProductList.DataSource = l_productlist;
//GridViewProductList.PageSize = 10;
//GridViewProductList.AllowPaging = true;
//GridViewProductList.RowCommand += new GridViewCommandEventHandler(GridViewProductList_ItemCommand);
//GridViewProductList.DataBind();
}
而爲母版的超級鏈接改變panguages:
MasterPage.aspx
<asp:HyperLink ID="linkChi" runat="Server"
ImageUrl="images/chinese.png" />
<asp:HyperLink ID="linkEng" runat="Server"
ImageUrl="images/english.png" />
MasterPage.aspx.cs
linkChi.NavigateUrl = "?currentculture=zh-hk";
linkEng.NavigateUrl = "?currentculture=en-us";
每當我按linkChi或林坑切換語言,它顯示的頁面是空白..
請你告訴我如何保證價值categoryID可以保留在頁面回發下?
我試圖改變語言,如果我按超鏈接 –