From: Deep on
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
From: Cubaman on
On Sep 11, 9:19 pm, Deep <vinod...(a)gmail.com> wrote:
> 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
 | 
Pages: 1
Prev: Animated Gif
Next: 2 C# Class's Questions