Click here to Skip to main content
14,358,698 members
Rate this:
Please Sign up or sign in to vote.
See more:
master page
<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
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)

  Print Answers RSS
Top Experts
Last 24hrsThis month



CodeProject, 503-250 Ferrand Drive Toronto Ontario, M3C 3G8 Canada +1 416-849-8900 x 100