asp.net 2.0
I prefer to send parameter between pages in a web application using GET (ex:
Default.aspx?id=1) so that the URL becomes unique so the user can add the
page to favorites...
Because I now uses a sitemap I can no longer use GET. I have to put it in a
session object... Is there a solution to make it possible to add pages to
favorite even if the parameter to the page is set in a session object?
Any suggestion?
Jeffhi jeff,
here is the code to convert session object to QueryString object (simple
object only):
private void Page_Load(object sender, EventArgs e)
{
if(!Page.IsPostBack)
{
ConvertSessionToQueryString("ABCSystem_INT_ID","id");
}
//use Request["id"] to do something.
}
private void ConvertSessionToQueryString(string sessionname, string
querystringname)
{
if (Session[sessionname]!=null&&Request[querystringname]==null)
{
string id = Session["SystemName_ObjectName_ID"].ToString();
Response.Redirect("Default.aspx?id="+id,true);
}
}
"Jeff" <it_consultant1@.hotmail.com.NOSPAM>
:e2HZgOcsGHA.1632@.TK2MSFTNGP06.phx.gbl...
Quote:
Originally Posted by
hey
>
asp.net 2.0
>
I prefer to send parameter between pages in a web application using GET
(ex: Default.aspx?id=1) so that the URL becomes unique so the user can add
the page to favorites...
>
Because I now uses a sitemap I can no longer use GET. I have to put it in
a session object... Is there a solution to make it possible to add pages
to favorite even if the parameter to the page is set in a session object?
>
Any suggestion?
>
Jeff
>
0 comments:
Post a Comment