access a button from the Master page

K

kieran

Hi,

I have a button which appears on many content pages...I want to be
able to make invisible to readers under a certain condition...how can
i access the button from the master page to do this...for
example...button1.visible = false.

I cant seem to access the button or its properties from the master
page...is there some way to do this.

Thanks...
 
C

coolCoder

Hi,

I have a button which appears on many content pages...I want to be
able to make invisible to readers under a certain condition...how can
i access the button from the master page to do this...for
example...button1.visible = false.

I cant seem to access the button or its properties from the master
page...is there some way to do this.

Thanks...

May I know the location of the button ? Is it on the content page or
placed in a content place holder on the master page ?

some code snippet can help !
 
K

kieran

Hi,

Thanks for response.

The button is in a gridview in a content placeholder. I have put a
code snippet below. As the buttons in a gridview, the delete button
will be repeated so I'm hoping to do a loop through of all buttons
with the 'delete' value...since they will all have different ids
dependant on the amount of rows in the grid.

-------------------------------


<asp:Content ID="Content1" ContentPlaceHolderID="ContentPlaceHolder1"
Runat="Server">
<div class="centre">

<asp:GridView ID="gvDevelopments" runat="server"
BackColor="White" OnSorting="gvUsers_Sorting"
BorderColor="#DEDFDE" BorderStyle="None" BorderWidth="1px"
CellPadding="4" CssClass="tester"
DataKeyNames="ID" DataSourceID="SqlDataSource1" Font-
Names="Verdana" Font-Size="Small" AllowSorting="True"
AutoGenerateColumns="False" ForeColor="Black" GridLines="Vertical">
<FooterStyle BackColor="#CCCC99" />
<Columns>

<asp:TemplateField >
<ItemTemplate >
<asp:Button ID="ButtonDelete" runat="Server"
CommandName="Delete" Font-Size="8pt"
Text="Delete" Width="45px" />
</ItemTemplate>
<ItemStyle VerticalAlign="Top" />
</asp:TemplateField>
 
C

coolCoder

Hi,

Thanks for response.

The button is in a gridview in a content placeholder. I have put a
code snippet below. As the buttons in a gridview, the delete button
will be repeated so I'm hoping to do a loop through of all buttons
with the 'delete' value...since they will all have different ids
dependant on the amount of rows in the grid.

-------------------------------

<asp:Content ID="Content1" ContentPlaceHolderID="ContentPlaceHolder1"
Runat="Server">
<div class="centre">

<asp:GridView ID="gvDevelopments" runat="server"
BackColor="White" OnSorting="gvUsers_Sorting"
BorderColor="#DEDFDE" BorderStyle="None" BorderWidth="1px"
CellPadding="4" CssClass="tester"
DataKeyNames="ID" DataSourceID="SqlDataSource1" Font-
Names="Verdana" Font-Size="Small" AllowSorting="True"
AutoGenerateColumns="False" ForeColor="Black" GridLines="Vertical">
<FooterStyle BackColor="#CCCC99" />
<Columns>

<asp:TemplateField >
<ItemTemplate >
<asp:Button ID="ButtonDelete" runat="Server"
CommandName="Delete" Font-Size="8pt"
Text="Delete" Width="45px" />
</ItemTemplate>
<ItemStyle VerticalAlign="Top" />
</asp:TemplateField>

Hi,
What for, you are thinking to iterate through delete buttons ?
So that you can delete that particular record ? What for you need ID
of that delete button.
If that is only for deleting record, then you can use the
RowCommand event for writing the delete code. Other wise you may
iterate through all the buttons on the form itself. But this is a very
untidy logic.
Just post me the actual requirement in complete details, so
that I may help you furthure.

Thanks,
coolCoder
 

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

Top