Click here to Skip to main content
15,891,184 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
I have an image button on master page as follows:
<asp:ImageButton ID="ImageButton1"  ImageUrl="images/Refresh.png" ToolTip="Refresh Image List" runat="server" OnClick="Refrshbtn_Click" class="ipdbuttons" Visible="true">

And i have another same image button on content page as follows:
<asp:ImageButton Visible="true" Style="width: 50px; font-size: x-large; max-width: 100px; text-align: left; margin-left: 385px; margin-top:9px;" ForeColor="#294b08" Height="95%" ImageUrl="images/Refresh.png" ToolTip="Refresh Image" runat="server" ID="ImageButton1" OnClick="Refrshbtn_Click">

I want to replace my content page image button with master page image button on load.

Please guide me...
Posted
Updated 27-Aug-14 20:18pm
v2
Comments
[no name] 28-Aug-14 2:15am    
your requirement is not clear why you want to replace you can do visible true false as per require time

1 solution

Add the below lines of code in page load event of content page

ImageButton imgBtn1 = Master.FindControl("ImageButton1") as ImageButton;
ImageButton1.Visible = false;
ImageButton1.Parent.Controls.Add(imgBtn1);
 
Share this answer
 

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