making a button not visible in a datagrid

  • Thread starter Thread starter Brett Wesoloski
  • Start date Start date
B

Brett Wesoloski

Ok I would expect this to be easy but am running into some problems.

I have a templete column in my datagrid with a button.

<asp:TemplateColumn HeaderText="E-Mail Proposal"
ItemStyle-HorizontalAlign="Center">
<ItemTemplate>
<input type="button" name="email" value="EMail"
onclick="OpenOutlookDoc('IPM.Note.FormA', '<%#
(DataBinder.Eval(Container.DataItem, "FilenameURL").ToString().Replace("\\",
"\\\\")) %>')" />
</ItemTemplate>
</asp:TemplateColumn>


Now I want to make this button visible at times and not visible at other
times. As you can see the on click called some java script. To get the
visible property to work I have tried to set the runat ="server" but I get
an error when I do this "The server tag is not well formed" Any idea how I
can get this to work?

TIA,
Brett
 
Hi,

You can modify the style of the button, basically you set the "visibility"
to either "hidden" or "visible" , you can do it from a script in the client

button1.style.visibility = "hidden";

You can do a similar thing in the server side.
 
Back
Top