CodeVerge.Net Beta
Login Idy
Register Password
  Forgot?
Explore    Item Entry    Members   
NEWSGROUP
.NET
Algorithms-Data Structures
Asp.Net
C Plus Plus
CSharp
Database
HTML
Javascript
Linq
Other
Regular Expressions
VB.Net
XML





Zone: > NEWSGROUP > Asp.Net Forum > general_asp.net.master_pages_themes_and_navigation_controls Tags:
Item Type: NewsGroup Date Entered: 1/24/2008 11:39:41 AM Date Modified: Subscribers: 0 Subscribe Alert
Rate It:
(NR, 0)
XPoints: N/A Replies: 4 Views: 13 Favorited: 0 Favorite
Can Reply:  No Members Can Edit: No Online: Yes
5 Items, 1 Pages 1 |< << Go >> >|
storm721984
Asp.Net User
Master Page and ImageButton issue....1/24/2008 11:39:41 AM

0/0

I'm using Visual Studio 2005 and C#

So my problem is that the code i run below does work on page that doesn't use Master Page but once i use Master Page it just doesn't seem to be able to work.

Is there anything i need to add in order for this code to work on web pages that has Maste Page?

 

string defineImageButton = "test1ImageButton";

ShowImageButton = (ImageButton)this.FindControl(defineImageButton);

ShowImageButton.Visible = false;

 

vik20000in
Asp.Net User
Re: Master Page and ImageButton issue....1/24/2008 11:52:49 AM

0/0

Is the image button in the master page. In that case u will have to use something like this

This.master.findcontrol("controlname");


vikram
http://www.vikramlakhotia.com
http://justlikethat.vikramlakhotia.com
http://whynot.vikramlakhotia.com

Please mark the answer as answered if it helped you
storm721984
Asp.Net User
Re: Master Page and ImageButton issue....1/24/2008 12:32:25 PM

0/0

I tried but doesn't seem to work as well.... And yes i already create the ImageButton on the web page that has master page

This is the code that i tried

string defineImageButton = "image1ImageButton";

ImageButton imgButton = (ImageButton)this.Master.FindControl(defineImageButton);

imgButton.Visible = false;

MorningZ
Asp.Net User
Re: Master Page and ImageButton issue....1/24/2008 1:08:35 PM

0/0

do a simple "View Source" on your page and find that button, you'll see that using MaterPage's changes the ID of controls (to keep them unique) Want more info? this article explains all (http://www.odetocode.com/Articles/450.aspx)


"If you make it idiot proof, they'll build a better idiot"
storm721984
Asp.Net User
Re: Master Page and ImageButton issue....1/24/2008 2:48:49 PM

0/0

Thanks for the guidance as i finally got it working by checking out the site Big Smile

Below are the source code that i tested out:

string defineImageButton = "image1ImageButton";

ImageButton imgButton = (ImageButton)Master.FindControl("ContentPlaceHolder1").FindControl(defineImageButton);

imgButton.Visible = false;

5 Items, 1 Pages 1 |< << Go >> >|



Search This Site:


Meet Our Sponsors:



Other Resources:

Ajax Controls not Recognized in code view in a Child of a Master Page ... which imagebutton was activated ? Zone: ... code\logic to generate userid and password automatically. asp.net licensing issue ...
Firefox updatepanel defaultbutton issue - asp.net_ajax.asp ... ... ToolkitScriptManager inside of my master page and I have enabledPartialRendering ... I changed my asp:ImageButton control to an asp:Button control and I ...
User control in Master Page - ASP.NET Forums <asp:ImageButton ID="btnArrow" ImageUrl="images/arrow.gif" ToolTip="Print Client" ... ASP.NET: Known issues for ASP.NET with .NET 3.5 SP1 ...
Feedback: Image Button OnClick + asp:Repeater type controls + Master ... Create a Root master, child master and content page that uses the child master. ... I have a repeater with an ItemTemplate containing a TextBox and an ImageButton. ...
Updating session variables with a master page on the content page (default.aspx) i have an imageButton. on the ... Intermittant URL redirection issue with Internet Explorer. newbie: allow deny vs deny allow ...
Issues question on master page - ASP.NET Forums ... General ASP.NET " Getting Started " Issues question on master page ... runat='server' controls (like asp:ImageButton), the url should be like "~/images ...
I have a problem with refreshing login membership page on the master ... ... the page to profile.aspx and I don't want to have this issue with refreshing the page. ... <input type="password" id="password" /></label> <asp:ImageButton ...


 
All Times Are GMT