samedi 31 janvier 2015

Read hidden field values from another page


Vote count:

0




I am developing a website using ASP.net.


In my home page I have 14 tree view controls. They were placed under Jquery tabs. So when a user click a tab it only appears one treeview. So in tree node changed event currently what I am doing is passing the values from query string to another page. this query string doesnt have any sensitive data. I have to pass what is the selected Tab Id and selected tree node Id.



Response.Redirect(String.Format("~/Display.aspx?tab=1&type={0}",treeview1.SelectedValue), true);


But you know URL is ugly. I dont want to use Friendly URL thing now. So what I did was I put 2 hidden fields values in my home page and I set them when I click the tree node.


So then from the source page I used this code to acess this.



if(Page.PreviousPage!=null)
{
string tab= Page.PreviousPage.FindControl("hftab").UniqueID;
string Type= Page.PreviousPage.FindControl("hfType").UniqueID;
}


But Page.PreviousPage always return NULL. So how to solve this probelem without using sessions and query string. I just want to pass two non sensitive data behind the scenes.



asked 1 min ago

Sylar

114






Read hidden field values from another page

Aucun commentaire:

Enregistrer un commentaire