making a button not visible in a datagrid

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
 
I

Ignacio Machin \( .NET/ C# MVP \)

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.
 

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