Search:
Namespaces
Discussions
.NET v1.1
Feedback
LinkButton CSS Class
Messages
Related Types
This message was discovered on
ASPFriends.com 'aspngfreeforall' list
.
Collins, Mike
Anyone out there have any ideas how to change the css class of a link button
when you click it? The trick here is, I'm creating the linkButtons
dynamically.
-Mike Collins
***********************************************************************
NOTICE: This e-mail message and all attachments transmitted with it may contain legally privileged and confidential information intended solely for the use of the addressee. If the reader of this message is not the intended recipient, you are hereby notified that any reading, dissemination, distribution, copying, or other use of this message or its attachments is strictly prohibited. If you have received this message in error, please notify the sender immediately by telephone (404-881-7000) or by electronic mail (
Click here to reveal e-mail address
), and delete this message and all copies and backups thereof. Thank you.
=======================================================
Reply to this message...
Will Johansson
Simply add an CssClass argument to the linkbutton during runtime. Should
work for example in C#:
<script language="C#" runat="server">
protected void Page_Load(Object Source,
EventArgs
e)
{
if (!IsPostBack) {
LinkButton1.CssClass = "FirstClass";
}
}
protected void csBtnClick(Object Source,
EventArgs
e)
{
LinkButton1.CssClass = "SecondClass";
}
</script>
Same concept applies in VB.NET:
<script language="VB" runat="server">
Sub Page_Load(Source as Object, e As EventArgs)
If Not IsPostBack Then LinkButton1.CssClass = "FirstClass"
End Sub
Sub csBtnClick(Source as Object, e As EventArgs)
LinkButton1.CssClass = "SecondClass"
End Sub
</script>
==== Somewhere in the HTML or ASP control ====
<asp:linkbutton id="LinkButton1" OnClick="csBtnClick" runat="server" />
====
That should do it.
Will
-----Original Message-----
From: Collins, Mike [mailto:
Click here to reveal e-mail address
]
Sent: Thursday, August 15, 2002 3:11 PM
To: aspngfreeforall
Subject: [aspngfreeforall]
LinkButton
CSS Class
Anyone out there have any ideas how to change the css class of a link
button
when you click it? The trick here is, I'm creating the linkButtons
dynamically.
-Mike Collins
***********************************************************************
NOTICE: This e-mail message and all attachments transmitted with it may
contain legally privileged and confidential information intended solely
for the use of the addressee. If the reader of this message is not the
intended recipient, you are hereby notified that any reading,
dissemination, distribution, copying, or other use of this message or
its attachments is strictly prohibited. If you have received this
message in error, please notify the sender immediately by telephone
(404-881-7000) or by electronic mail (
Click here to reveal e-mail address
), and delete
this message and all copies and backups thereof. Thank you.
=======================================================
| ASP.net DOCS =
http://www.aspng.com/docs
| [aspngfreeforall] member
Click here to reveal e-mail address
= YOUR ID
|
http://www.asplists.com/aspngfreeforall
= JOIN/QUIT
| news://ls.asplists.com = NEWSGROUP
Reply to this message...
Collins, Mike
How do I know which one was clicked? They're named at runtime
-----Original Message-----
From: Will Johansson [mailto:
Click here to reveal e-mail address
]
Sent: Thursday, August 15, 2002 4:04 PM
To: aspngfreeforall
Subject: [aspngfreeforall] RE:
LinkButton
CSS Class
Simply add an CssClass argument to the linkbutton during runtime. Should
work for example in C#:
<script language="C#" runat="server">
protected void Page_Load(Object Source,
EventArgs
e)
{
if (!IsPostBack) {
LinkButton1.CssClass = "FirstClass";
}
}
protected void csBtnClick(Object Source,
EventArgs
e)
{
LinkButton1.CssClass = "SecondClass";
}
</script>
Same concept applies in VB.NET:
<script language="VB" runat="server">
Sub Page_Load(Source as Object, e As EventArgs)
If Not IsPostBack Then LinkButton1.CssClass = "FirstClass"
End Sub
Sub csBtnClick(Source as Object, e As EventArgs)
LinkButton1.CssClass = "SecondClass"
End Sub
</script>
==== Somewhere in the HTML or ASP control ====
<asp:linkbutton id="LinkButton1" OnClick="csBtnClick" runat="server" />
====
That should do it.
Will
-----Original Message-----
From: Collins, Mike [mailto:
Click here to reveal e-mail address
]
Sent: Thursday, August 15, 2002 3:11 PM
To: aspngfreeforall
Subject: [aspngfreeforall]
LinkButton
CSS Class
Anyone out there have any ideas how to change the css class of a link
button
when you click it? The trick here is, I'm creating the linkButtons
dynamically.
-Mike Collins
***********************************************************************
NOTICE: This e-mail message and all attachments transmitted with it may
contain legally privileged and confidential information intended solely
for the use of the addressee. If the reader of this message is not the
intended recipient, you are hereby notified that any reading,
dissemination, distribution, copying, or other use of this message or
its attachments is strictly prohibited. If you have received this
message in error, please notify the sender immediately by telephone
(404-881-7000) or by electronic mail (
Click here to reveal e-mail address
), and delete
this message and all copies and backups thereof. Thank you.
=======================================================
| ASP.net DOCS =
http://www.aspng.com/docs
| [aspngfreeforall] member
Click here to reveal e-mail address
= YOUR ID
|
http://www.asplists.com/aspngfreeforall
= JOIN/QUIT
| news://ls.asplists.com = NEWSGROUP
| ASP.net DOCS =
http://www.aspng.com/docs
| [aspngfreeforall] member
Click here to reveal e-mail address
= YOUR ID
|
http://www.asplists.com/aspngfreeforall
= JOIN/QUIT
| news://ls.asplists.com = NEWSGROUP
***********************************************************************
NOTICE: This e-mail message and all attachments transmitted with it may contain legally privileged and confidential information intended solely for the use of the addressee. If the reader of this message is not the intended recipient, you are hereby notified that any reading, dissemination, distribution, copying, or other use of this message or its attachments is strictly prohibited. If you have received this message in error, please notify the sender immediately by telephone (404-881-7000) or by electronic mail (
Click here to reveal e-mail address
), and delete this message and all copies and backups thereof. Thank you.
=======================================================
Reply to this message...
Will Johansson
<asp:linkbutton id="LinkButton1" ::::::OnClick="csBtnClick"::::::
runat="server" />
It calls on the csBtnClick function. You can add arguments for
specifying which button does what or make another csBtnClick function
(for multiple instances, I suggest more complex stuff that you can do
Dim csBtnClick1 As New buttonClickWhatever...).
Like if you have two linkbuttons, simply have two separate functions for
each like csBtnBUTTONIDClick and have it direct to Class2, and have a
second function for the second button.. CsBtnBUTTONID2Click and have it
direct to Class3.
Again, I was just posting the simple concept. Try it out and grasp the
concept, then fool around.
Will
-----Original Message-----
From: Collins, Mike [mailto:
Click here to reveal e-mail address
]
Sent: Thursday, August 15, 2002 4:07 PM
To: aspngfreeforall
Subject: [aspngfreeforall] RE:
LinkButton
CSS Class
How do I know which one was clicked? They're named at runtime
-----Original Message-----
From: Will Johansson [mailto:
Click here to reveal e-mail address
]
Sent: Thursday, August 15, 2002 4:04 PM
To: aspngfreeforall
Subject: [aspngfreeforall] RE:
LinkButton
CSS Class
Simply add an CssClass argument to the linkbutton during runtime. Should
work for example in C#:
<script language="C#" runat="server">
protected void Page_Load(Object Source,
EventArgs
e)
{
if (!IsPostBack) {
LinkButton1.CssClass = "FirstClass";
}
}
protected void csBtnClick(Object Source,
EventArgs
e)
{
LinkButton1.CssClass = "SecondClass";
}
</script>
Same concept applies in VB.NET:
<script language="VB" runat="server">
Sub Page_Load(Source as Object, e As EventArgs)
If Not IsPostBack Then LinkButton1.CssClass = "FirstClass"
End Sub
Sub csBtnClick(Source as Object, e As EventArgs)
LinkButton1.CssClass = "SecondClass"
End Sub
</script>
==== Somewhere in the HTML or ASP control ====
<asp:linkbutton id="LinkButton1" OnClick="csBtnClick" runat="server" />
====
That should do it.
Will
-----Original Message-----
From: Collins, Mike [mailto:
Click here to reveal e-mail address
]
Sent: Thursday, August 15, 2002 3:11 PM
To: aspngfreeforall
Subject: [aspngfreeforall]
LinkButton
CSS Class
Anyone out there have any ideas how to change the css class of a link
button
when you click it? The trick here is, I'm creating the linkButtons
dynamically.
-Mike Collins
***********************************************************************
NOTICE: This e-mail message and all attachments transmitted with it may
contain legally privileged and confidential information intended solely
for the use of the addressee. If the reader of this message is not the
intended recipient, you are hereby notified that any reading,
dissemination, distribution, copying, or other use of this message or
its attachments is strictly prohibited. If you have received this
message in error, please notify the sender immediately by telephone
(404-881-7000) or by electronic mail (
Click here to reveal e-mail address
), and delete
this message and all copies and backups thereof. Thank you.
=======================================================
| ASP.net DOCS =
http://www.aspng.com/docs
| [aspngfreeforall] member
Click here to reveal e-mail address
= YOUR ID
|
http://www.asplists.com/aspngfreeforall
= JOIN/QUIT
| news://ls.asplists.com = NEWSGROUP
| ASP.net DOCS =
http://www.aspng.com/docs
| [aspngfreeforall] member
Click here to reveal e-mail address
= YOUR ID
|
http://www.asplists.com/aspngfreeforall
= JOIN/QUIT
| news://ls.asplists.com = NEWSGROUP
***********************************************************************
NOTICE: This e-mail message and all attachments transmitted with it may
contain legally privileged and confidential information intended solely
for the use of the addressee. If the reader of this message is not the
intended recipient, you are hereby notified that any reading,
dissemination, distribution, copying, or other use of this message or
its attachments is strictly prohibited. If you have received this
message in error, please notify the sender immediately by telephone
(404-881-7000) or by electronic mail (
Click here to reveal e-mail address
), and delete
this message and all copies and backups thereof. Thank you.
=======================================================
| ASP.net DOCS =
http://www.aspng.com/docs
| [aspngfreeforall] member
Click here to reveal e-mail address
= YOUR ID
|
http://www.asplists.com/aspngfreeforall
= JOIN/QUIT
| news://ls.asplists.com = NEWSGROUP
Reply to this message...
System.EventArgs
System.Web.UI.WebControls.LinkButton
Ad
MBR BootFX
Best-of-breed application framework for .NET projects, developed by Matthew Baxter-Reynolds and MBR IT
Copyright © Matthew Baxter-Reynolds 2001-2008. '.NET 247 Software Development Services' is a trading style of MBR IT Solutions Ltd.
Contact Us
-
Terms of Use
-
Privacy Policy
-
www.dotnet247.com