I'm currently using Request.QueryString to pass id. Just like below
Response.Redirect("Page1.aspx?dpid=" + Request.QueryString["dpid"] + "&eid=" + Request.QueryString["eid"]);
So if I use menu to go to another page, the query string will not be pass because i unable to pass the query string in menu.
<asp:menu id="Menu1" runat="server" maximumdynamicdisplaylevels="10" cssclass="menu"
="" orientation="Horizontal" staticdisplaylevels="5" staticsubmenuindent="16px" width="900px">
<items>
<asp:menuitem navigateurl="~/Page1.aspx" text="View IT Asset"
="" value="View IT Asset">
<asp:menuitem navigateurl="~/Page2.aspx" text="View IT Asset Type"
="" value="View IT Asset Type">
<asp:menuitem navigateurl="~/Page3.aspx" text="Dispose" value="Dispose">
<asp:menuitem navigateurl="~/Page4.aspx" text="View Request"
="" value="View Request">
<asp:menuitem navigateurl="~/Page5.aspx" text="Issue/Reject"
="" value="Issue/Reject">
<asp:menuitem navigateurl="~/Page6.aspx" text="Return Device"
="" value="Return Device">
<staticitemtemplate>
<%# Eval("Text") %>
What I have tried:
So I am currently using button on every page to do it like menu. Just like below. It's work to pass the query string but it's look messy. Is that possible to pass query string in menu or any other better solution?
protected void Button3_Click(object sender, EventArgs e)
{
Response.Redirect("Page1.aspx?dpid=" + Request.QueryString["dpid"] + "&eid=" + Request.QueryString["eid"]);
}
protected void Button4_Click(object sender, EventArgs e)
{
Response.Redirect("Page2.aspx?dpid=" + Request.QueryString["dpid"] + "&eid=" + Request.QueryString["eid"]);
}
protected void Button5_Click(object sender, EventArgs e)
{
Response.Redirect("Page3.aspx?dpid=" + Request.QueryString["dpid"] + "&eid=" + Request.QueryString["eid"]);
}
protected void Button6_Click(object sender, EventArgs e)
{
Response.Redirect("Page4.aspx?dpid=" + Request.QueryString["dpid"] + "&eid=" + Request.QueryString["eid"]);
}
protected void Button7_Click(object sender, EventArgs e)
{
Response.Redirect("Page5.aspx?dpid=" + Request.QueryString["dpid"] + "&eid=" + Request.QueryString["eid"]);
}
protected void Button8_Click(object sender, EventArgs e)
{
Response.Redirect("Page6.aspx?dpid=" + Request.QueryString["dpid"] + "&eid=" + Request.QueryString["eid"]);
}