473,385 Members | 1,872 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,385 software developers and data experts.

Link Button css

Hello all,
I have an issue in LinkButtonCss.
I've an javascript funtion,

Expand|Select|Wrap|Line Numbers
  1.  function ActiveLink() {
  2.         var InpHide1 = document.getElementById('<%= InpHide.ClientID %>');
  3.         var InpHideLB = document.getElementById('<%= InpHideLB.ClientID %>');
  4.         if (InpHide1.value != "0") {
  5.             //link button text color css is pending
  6.             var TDId = document.getElementById(InpHide1.value);
  7.             TDId.className = "Header1";
  8.             alert(InpHideLB.value);
  9.             var LinkButton = document.getElementById(InpHideLB.value);
  10.             LinkButton.className = "lnkVisited";
  11.         }
  12.     }
  13.  
  14.     function lnkClicked(lnkButtonTD, linkButton) {
  15.         document.getElementById('<%= InpHide.ClientID %>').value = lnkButtonTD;
  16.         document.getElementById('<%= InpHideLB.ClientID %>').value = linkButton;
  17.     }
  18.  
  19. and 
  20.  <asp:LinkButton ID="LBTicket" runat="server" Width="100%" CssClass="lnkButton" 
  21.                                             onclick="LBTicket_Click"   OnClientClick="lnkClicked('LBTicket1','LBTicket')" CausesValidation="False"> Ticket</asp:LinkButton>
  22.  
in which linkbutton id is passed as string.
but document.getElementById(InpHideLB.value);
var LinkButton = document.getElementById(InpHideLB.value);
LinkButton.className = "lnkVisited"
is not working...
Sep 12 '13 #1
1 1453
Hi Anki1989,

Did you find an answer to your question? I was thinking about this, have not setup a test page, but it seems to me you are mixing ASP.NET with HTML/DOM code. An HTML Button has a className, while in ASP.NET the LinkButton has CssClass attribute. You can see it on MSDN site:
http://msdn.microsoft.com/en-us/libr....cssclass.aspx

Also, you do not include the InpHide control in the code snippet. Is this a hidden control you use to store the value of the LinkButton and the parent container (possibly a table cell <TD>)? There are other ways to persist these values, just wondering how you intend for ActiveLink() function to get these values. Security features can sometimes get in the way of accessing controls from code.

Cheers!
Sep 30 '13 #2

Sign in to post your reply or Sign up for a free account.

Similar topics

0
by: Normie Smith | last post by:
Hello... I have a strange situation happening, and I thought maybe I could get some assistance. I have created a simple user control (.ascx) file that's part of my default.aspx page. The user...
1
by: Darren Clark | last post by:
I have a link button that i would like to be used if the value of the text is NOT 0... So the code below will always make a linkbutton.... However if the value of...
0
by: Dailan | last post by:
Hi, I create a tree view. Each node has link button associate with it, which includes add, edit, delete buttons. The way I did is for users who have very low capablity of using computer. Now I...
2
by: Dot net work | last post by:
I have a 3rd party link button control that when clicked does not retain it's visited color status on postback. (Actually, the first control on the form does, but all others do not.) When I...
1
by: GTDriver | last post by:
I'm trying to determine how to create a page with data from the database and I want to use the link button to have the user click on. Once the user clicks on the link button I want to transfer...
4
by: Kurt Schroeder | last post by:
I am trying to add a link button to a calendar. this is a simple example: Private Sub Calendar1_DayRender(ByVal sender As Object, ByVal e As System.Web.UI.WebControls.DayRenderEventArgs) Handles...
3
by: Shimon Sim | last post by:
I put linkbutton in a repeater header. I attached event handler in makeup as onclick="btnSort_Click". Made btnSort_Click method public. It doesn't fire if I click on it. I tried to attach it in...
2
by: pradeep_TP | last post by:
Hello world, I have a simple datagrid on asp.net web form , in which I am showing a single button column called EDIT. The code in the .aspx files for the same is as below. ...
0
by: Ty | last post by:
I have a page that has three gridviews on it. In each gridview the first column is a link button representing a Database ID field. What I'm trying to accomplish is to email that page and click on...
5
by: developApps | last post by:
This problem only occurs in Firefox.... I have a page (page 1) with a link button. The link button uses response.redirect to pass parameters and take me to a second page (page 2) when the...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
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
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
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...

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.