Help with server control

Results 1 to 2 of 2

Thread: Help with server control

  1. #1
    Join Date
    Dec 1969

    Default Help with server control

    I am trying to change the font size, color for these specific linkbuttons depending on which page the user is on... But I am having problem with a little syntax. Can anyone help?<BR>I want to change the Nextpage linkbutton to red if the user is on the last page. I have tried everything but I keep getting all sorts of syntax errors.<BR><BR>I tried NextPage.Font.Size=2 ---- doesn&#039;t work<BR><BR>If CurrentPage = Pages Then<BR><BR> Nextpage.Enabled = False<BR> LastPage.Enabled = False<BR> <BR>Else<BR><BR> NextPage.Enabled = True<BR> LastPage.Enabled = True<BR> NextPage.CommandArgument = CurrentPage + 1<BR> LastPage.CommandArgument = varPages<BR><BR>End If

  2. #2
    Join Date
    Dec 1969

    Default RE: Help with server control

    Ummm... you said that you want to change the "linkbutton to red", but your code is trying to change the font size!?!?!?<BR><BR>If you want to change the font size, the docs say:<BR>"Use the Font property to specify the font properties of the Web Server control. This property includes subproperties that can be accessed declaratively in the form of Property-Subproperty (for example Font-Bold) or programmatically in the form of Property.Subproperty (for example Font.Bold).<BR><BR>All but one subproperty will render in browsers prior to Microsoft Internet Explorer version 4 for all controls. They are: Bold, Italic, Name, Names, Strikeout, Underline, and Size (but only named font sizes, such as Small, Smaller, and so on, will work).<BR><BR>Note Although these subproperties render in browsers prior to Microsoft Internet Explorer version 4, the HTML that is rendered is different than later browsers. Instead of rendering as style attributes, these subproperties are rendered as HTML elements, such as &#060;b&#062; and &#060;font&#062;."<BR><BR>If you want to change the color (the whole button or just the text?) use .ForeColor or .BackColor<BR><BR>if I were going to do it, I would just create two CSS classes and change the linkbutton&#039;s CssClass property programatically.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts