473,396 Members | 2,087 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,396 software developers and data experts.

Dinamically changing "LinkButton" control style!

I'am trying to change the style of my LinkButton
control .
I have a set of five control and i need to hilight the selected one. I want
to achive this
by setting MyLinkButton.CssClass="newStyle"
whenever "Mybutton_Click" is fired.

I have set MyLinkButton.CssClass="OldStyle"

in the code behind.

The buttons never get "newStyle. What i am doig wrong?

Thanks In Advance

J.B
Nov 18 '05 #1
2 2026
In the codebehind, are you setting MyLinkButton.CssClass in the
Page_Load procedure?

If so, make sure that the MyLinkButton.CssClass is set like so:

Sub Page_Load()
If Not Page.IsPostBack
MyLinkButton.CssClass="OldStyle"
End If
End Sub

The first time the page loads, it will use oldstyle, and when a button
is clicked and MyButton_Click is fired, it ignore code above as a
postback has occurred.

Regards,
matt

"Jensen bredal" <je***********@mimosa.com> wrote in message news:<eI**************@TK2MSFTNGP11.phx.gbl>...
I'am trying to change the style of my LinkButton
control .
I have a set of five control and i need to hilight the selected one. I want
to achive this
by setting MyLinkButton.CssClass="newStyle"
whenever "Mybutton_Click" is fired.

I have set MyLinkButton.CssClass="OldStyle"

in the code behind.

The buttons never get "newStyle. What i am doig wrong?

Thanks In Advance

J.B

Nov 18 '05 #2
Right, that is exactly what i'm doing.
The thing is that fro some reason, the code
lways goes through:
(IsPostback=false )
{
}

It seems like a LinkButton click does not cause (IsPosback=true)

I look up the IsPostBack property but the msdn help
says so litle about when exactly it cause to be true.

I recall someone here said it was true when "data of a form was posted back
to the server."

Well i must say i'm very confused now


"Matt Haughton" <sn******@mail.com> wrote in message
news:e0*************************@posting.google.co m...
In the codebehind, are you setting MyLinkButton.CssClass in the
Page_Load procedure?

If so, make sure that the MyLinkButton.CssClass is set like so:

Sub Page_Load()
If Not Page.IsPostBack
MyLinkButton.CssClass="OldStyle"
End If
End Sub

The first time the page loads, it will use oldstyle, and when a button
is clicked and MyButton_Click is fired, it ignore code above as a
postback has occurred.

Regards,
matt

"Jensen bredal" <je***********@mimosa.com> wrote in message

news:<eI**************@TK2MSFTNGP11.phx.gbl>...
I'am trying to change the style of my LinkButton
control .
I have a set of five control and i need to hilight the selected one. I want to achive this
by setting MyLinkButton.CssClass="newStyle"
whenever "Mybutton_Click" is fired.

I have set MyLinkButton.CssClass="OldStyle"

in the code behind.

The buttons never get "newStyle. What i am doig wrong?

Thanks In Advance

J.B

Nov 18 '05 #3

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

Similar topics

8
by: msnews.microsoft.com | last post by:
I want to redirect the user to a url outside of our website but I want it to preserve our application's window by opening a new window. We have a datagrid that has five hyperlink columns containing...
0
by: Alessandro | last post by:
There is a way to "disable" or remove button to go to next month ? I want, for example, that a user can move from 01/01/2003 to 31/12/2003 but not in 2004..... Any idea ?
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 =...
4
by: Daniel | last post by:
Hi, I have problem to get the control id and set its visible to true/false(mean show/hide). here is my code: <%@ Control Language="vb" AutoEventWireup="false" Codebehind="ucNavbar.ascx.vb"...
9
by: Max Weebler | last post by:
Hi, I have a datagrid built that has an alternating item style that sets the backcolor and ForeColor of its rows. I have 4 template columns. One of them has a LinkButton embedded in it to...
7
by: Alex Maghen | last post by:
I have a DataGrid control with a LinkButton command column that deletes the row. What I want to do is set it up so that there's a client-side Confirm alert BEFORE the actual Delete command gets...
1
by: DC | last post by:
The problem I'm using the .NET GridView and FormView objects for the first time and im getting the error "An OleDbParameter with ParameterName '@ID' is not contained by this...
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: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
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:
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,...
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...
0
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
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...

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.