0

I have used QueryString to take value from clicked menu, on redirect I filter values of page on basis of QueryString value. But every time Request.QueryString returns the same value even if there are different value in url. On ASPX page I written below code

    Response.Write("<a href='../SubCategory.aspx?SubCategoryID=" + subcatArrayID5.ElementAt(i) + "'>" + subcatArrayName5.ElementAt(i) + "</a>");

and access it using below code in SubCategory.aspx Page

    if (!Page.IsPostBack) { 
    if (Request.QueryString["SubCategoryID"] != null) { 
        SubCategoryID = Request.QueryString["SubCategoryID"].ToString(); 
        Div1.InnerHtml = Request.QueryString["SubCategoryID"]; 
    } 
    Databind(); 
}
10
  • Can you post the code where you are accessing the values of QueryString? Commented Feb 1, 2018 at 10:48
  • Can you also type the code that re-directs to the other page based on this value? Commented Feb 1, 2018 at 10:50
  • Could you add all that to the question itself? Just for readability purposes Commented Feb 1, 2018 at 10:57
  • @DIe i have added code in question now. Commented Feb 1, 2018 at 11:12
  • @Ahmad i have added code in question now Commented Feb 1, 2018 at 11:13

0

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.