i need to fill dropdownlist and use its selected value in inline code to fill href of menu items .
example : i have DropCountry and fill it from DB then i get the location of client and set the selectedindex with this value , so i want to set href of menuitem with Query string of CountryID taken from dropCountry.selectedValue.
but he compile the inline Code before Codebehind :S
"Details.aspx?AdID=<%# DataBinder.Eval(Container.DataItem, "AdID")%>&CatID=<% Response.Write(GetIDCatFromQueryString()); %>&Country=<% i need to get value here %>"
Here is my solution for you:
I suspect that you are binding the menu item with datasource so the databinding of the menuitme happens before the page load where you have set the drop down list items and selected one of them so i suggest that in your page load, make the steps as following:
OR
You can fill the drop down list and select an item in the Page_OnInt event.
In Both cases you have to update you code by adding <%# YourDropDownList.SelectedValue %>