473,467 Members | 1,436 Online
Bytes | Software Development & Data Engineering Community
Create Post

Home Posts Topics Members FAQ

Linkbutton does not look like a linkbutton

OK, I almost got my problem solved. Zen is almost there! Just that a
LinkButton control inside a column in my datagrid doesn't show like a
link button. It does not have an underlining. My client side JavaScript
is enabled. How do I make the button underlined and appear and act like
a linkbutton? Currently, it just displays the text like a normal
label/table cell that has a label.

Nov 19 '05 #1
3 1804
It looks like the LinkButton cannot be databound. If it is, it just
disappears. As a test, I tried this:

<asp:TemplateColumn HeaderText="Full Name">
<ItemTemplate>
<asp:LinkButton OnClick="dg_ItemCommand">
<%# DataBinder.Eval(Container.DataItem, "Full Name")%>
</asp:LinkButton>
</ItemTemplate>
</asp:TemplateColumn>
The column displays the correct full name value but no underlining. I
am guessing that the grid replaced the linkbutton with a literal
control. I did this and found out.

lblMessage.Text = dg.Items(1).Cells(0).Controls(0).GetType.ToString

in a button_click.
Then, I tried this:

<asp:LinkButton id="lnk" style="Z-INDEX: 104; LEFT: 432px; POSITION:
absolute; TOP: 80px" runat="server">The date and time is: <%#
System.DateTime.Now.ToLongDateString %></asp:LinkButton>

And it only showed the link button with the text

The date and time is:
How do I have a control in a grid that:

(1) Is DataBound
(2) Appears and acts like a linkbutton
(3) Does not behave like the ItemTemplate's EditItem where you have
those edit textboxes inside the grid itself.

Nov 19 '05 #2
Sathyaish wrote:
OK, I almost got my problem solved. Zen is almost there! Just that a
LinkButton control inside a column in my datagrid doesn't show like a
link button. It does not have an underlining. My client side
JavaScript is enabled. How do I make the button underlined and appear
and act like a linkbutton? Currently, it just displays the text like
a normal label/table cell that has a label.


Does it *work* like a linkbutton?
That linkbutton is just a regular hyperlink for the browser, so standard CSS applies.
Does your CSS remove that underlining from all hyperlinks?

Hans Kesting
Nov 19 '05 #3
No, the default CSS, Styles.css in my solution does the formatting and
it doesn't override any default styles. So, if I look at a new
LinkButton that I drag from the toolbox to the web form, it looks
alright and behaves alright.

Just that when I try to bind it, it disappears. Look at my post above
in this same thread. I am suspecting that the link button does not
support data binding.

Can you give me an alternative for a control that data binds and also
acts like a link and has a post method rather than redirect?

Nov 19 '05 #4

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

4
by: clintonG | last post by:
Any folklore regarding the benefits of using one or the other of these controls? <%= Clinton Gallagher METROmilwaukee (sm) "A Regional Information Service" NET csgallagher AT...
10
by: Bharat | last post by:
Hi Folks, Suppose I have two link button on a page (say lnkBtn1 and lnkBtn2). On the click event of the lnkbtn1 I have to add a dynamically created control. And On the click event of the lnkBtn2 I...
10
by: Vi | last post by:
Hi, I'm trying to dinamically add LinkButton Controls to a web form. I do something like: for(i=1;i<=someVariable;i++) { LinkButton PageLink = new LinkButton(); PageLink.CommandName =...
1
by: smash2004 | last post by:
I have VS 2005 CTP. I created a page with one repeater. Inside i put a linkbutton. Usually when i put linkbutton on a page I doubleclick it in designview and event gets created in codebehind...
3
by: MRW | last post by:
I have a simple linkbutton and a function when it's clicked. It works perfectly in a regular .aspx page. However, when I place it inside the ContentPlaceHolder, it no longer works. It does...
13
by: rn5a | last post by:
In a shopping cart app, suppose a user has placed 5 orders, I want to show him 5 LinkButtons (one for each order) so that when he clicks the first LinkButton, he would be shown the details of his...
0
by: OceanBreeze | last post by:
I have added a LinkButton to a table cell programmatically inside the Page_Load method. I also added a custom event to that link button. The same custom event is valid for all the link buttons. The...
6
by: Mel | last post by:
I have a website that allows the user to generate a new quote. When they are finished creating the quote, it brings them to the final page (called the Goodbye.aspx page) which just states the...
4
by: Jeff | last post by:
Hi, I have a ASP.NET 2.0 Web Application. Many of the pages use the ASP.NET GridView with paging and sorting. One of the columns of this Gridview is a template column (LinkButton). The data being...
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
1
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
0
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and...
0
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.