473,699 Members | 2,527 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Link Button css

1 New Member
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.getEle mentById(InpHid eLB.value);
var LinkButton = document.getEle mentById(InpHid eLB.value);
LinkButton.clas sName = "lnkVisited "
is not working...
Sep 12 '13 #1
1 1533
jeffreyk16
1 New Member
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
277
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 control contains a link button control, such as: <asp:LinkButton id="idLinkButtonopenAll" runat="server">open all</asp:LinkButton> Then in my code-behind file, I have it's event handler, such as:
1
390
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 "DataBinder.Eval(Container,"DataItem."+ JR.Core.Data.JobseekerData.FLD_SEARCH_MATCHES) " is 0 i do not want the the 0 to become a link.... I simply want to display it as text. How can i do this? <asp:LinkButton CommandArgument='<%# DataBinder.Eval(Container,"DataItem."+...
0
1452
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 encoutered problem. At certain situation the event does not fire when I click my link button. I generate my tree and link button on fly, and associate event with button. Tree is in my top panel. Detail information of each node is in my bottom panel....
2
1650
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 hover the mouse over the link button control, I can see the custom javascript in the browser's status bar. It puts a wrapper around the usual __doPostBack function call. Is this wrapper causing IE to get confused as to the visited status of the...
1
3625
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 them to another page, passing, for example, the customer id from my database. How to I create a url for this link button, that includes the page name and passing the page emp_id=1 as the argument? -- Sincerely,
4
4519
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 Calendar1.DayRender If e.Day.Date = Now.Date Then Dim lbtntemp As New LinkButton lbtntemp.Text = "go here" lbtntemp.ID = "thsLnk" e.Cell.Controls.Add((lbtntemp)) End If
3
4159
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 ItemDataBound event but I think it is too late. What am I doing wrong? Thanks Shimon.
2
10043
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. <asp:ButtonColumn HeaderText="" ButtonType="LinkButton" Text="Edit" CommandName="EditRec">
0
1201
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 the link button to open the page. The problem. When I send the page to myself on the same PC that I am creating the site on and open the email the gridviews are there. When I click on the link button I get an unspecified error. When I place...
5
4569
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 lnkButton_click event is fired. Most of the time, the functionality works. However, if a user clicks any other button on the page and then comes back to page 1 using the browser's back button, the link button redirects to that last page. Meaning, the...
0
8705
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, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
9196
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, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
1
8941
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 Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
7784
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, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
0
5879
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 then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
4390
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 last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
0
4637
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
2
2362
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
3
2015
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

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.