How to take master page control value in .aspx page

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
 
C

Cubaman

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
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,744
Messages
2,569,483
Members
44,903
Latest member
orderPeak8CBDGummies

Latest Threads

Top