Click here to Skip to main content
15,891,567 members
Please Sign up or sign in to vote.
5.00/5 (1 vote)
See more:
master page
XML
<asp:DropDownList ID="drpCountry" runat="server" AutoPostBack="true" OnSelectedIndexChanged="drpCountry_SelectedIndexChanged">
                            <asp:ListItem Text="India"></asp:ListItem>
                            <asp:ListItem Text="USA"></asp:ListItem>
                        </asp:DropDownList>

master.cs
C#
protected void drpCountry_SelectedIndexChanged(object sender, EventArgs e)
   {
       Session["country"] = drpCountry.SelectedItem.Text;
   }


content page.cs
protected void dlTopProducts_ItemDataBound(object sender, DataListItemEventArgs e)
{
if (e.Item.ItemType == ListItemType.Item ||
e.Item.ItemType == ListItemType.AlternatingItem)
{
Label lbl = (Label)e.Item.FindControl("lblPriceLogo");
DropDownList drp = (DropDownList)Master.FindControl("drpCountry");

if (drp.SelectedItem.Text.Trim()== "India")
{
lbl.Text = "Rs";
}
else
{
lbl.Text = "USD";
}

}

}
Posted
Comments
CBadger 21-Jan-14 6:17am    
What happens in the drpCountry_SelectedIndexChanged method?
njammy 21-Jan-14 7:57am    
What is triggering your content page dlTopProducts_ItemDataBound event?

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