Click here to Skip to main content
15,906,467 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
Hiiiii

i have a masterpage contain : dropdownlist called (droplanguage)

i have another page called order.aspx contain another dropdownlist called (dropOrders)



(dropOrders)display the data in language depending on the value of (droplanguage)

my problem is when i go to order.aspx page i must select the droplanguage again to see the data in (dropOrders)


i want that when i go to order.aspx page i found data in (droporder) automaticlly depending on last value of (droplanguage)


I Expect that it can be done using Sessions
anyone can tell me How i can do That ????

Thannnnnnnk Yooooooooooou :)
Posted

1 solution

You can store the selected value of droplanguage in a session variable on SelectedIndexChanged event like this:
Session["DropLang_Value"] = droplanguage.SelectedValue;


You can then access and fetch value of this session variable on Order.aspx like this:
string dropLangVal = Session["DropLang_Value"].ToString();


Hope this will help you. :)
 
Share this answer
 
Comments
Ankur\m/ 21-Feb-11 2:12am    
And finally, assign that value to the dropdownlist on page load. :)
nagendrathecoder 21-Feb-11 2:16am    
Oh yes, i missed that. :P
Thanks :)
Hercal 21-Feb-11 4:24am    
thanx Ankur and nagedrathecoder it works
but it required to select language when i run the website
if my droplanguage is automatic selected on English and when i go to order.aspx
an error occured because value is null
i hope you understand me,Sorry for my bad English

also i want to keep the SelectedItem all over my all pages , please help me :)
nagendrathecoder 21-Feb-11 4:40am    
Ok, so you can give an initial value as "English" to that session variable and change it if user selects some other value from droplanguage, so that its value won't be null at any time.
Hercal 21-Feb-11 5:08am    
sorry man ,can u tell me how to set initial value to drop down list

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900