How to take master page control value in .aspx page

  • Thread starter Thread starter Deep
  • Start date Start date
D

Deep

Dear friends,

Please tell me how to take master page control value in .aspx
page.
I have a master page name master1.master, which holds one drop down
<asp:DropDownList ID="ddlName" runat="server">
<asp:ListItem>Vinod</asp:ListItem>
<asp:ListItem>Manoj</asp:ListItem>
<asp:ListItem>Alok</asp:ListItem>
<asp:ListItem>Amit</asp:ListItem>
<asp:ListItem>Osho</asp:ListItem>
<asp:ListItem>Ganesh</asp:ListItem>
</asp:DropDownList>

and suppose one other page home.aspx which inherits this master page.
where I want to find ddlName selected value on selectedIndexChanged of
dropdown.

Thanks in Advance
Vinod Kumar
 
Dear friends,

         Please tell me how to take master page control value in .aspx
page.
I have a master page name master1.master, which holds one drop down
<asp:DropDownList ID="ddlName" runat="server">
                <asp:ListItem>Vinod</asp:ListItem>
                <asp:ListItem>Manoj</asp:ListItem>
                <asp:ListItem>Alok</asp:ListItem>
                <asp:ListItem>Amit</asp:ListItem>
                <asp:ListItem>Osho</asp:ListItem>
                <asp:ListItem>Ganesh</asp:ListItem>
            </asp:DropDownList>

and suppose one other page home.aspx which inherits this master page.
where I want to find ddlName selected value on selectedIndexChanged of
dropdown.

Thanks in Advance
Vinod Kumar

Hello:
Cast the property "Master" of home.aspx to your MasterPage class.

MyMasterpageClass mpc = this.Master;
string myValue = mpc.ddlName.SelectedValue;


Best Regards
 
Back
Top