0

In the webforms application, I am trying to conditionally set the CssClass for this panel like this, but it does not work...

<asp:Panel ID="pnlFooter" runat="server"  Width="26.67cm" CssClass="">
<% If (prpLastVID() = Eval("UID_VEHICLE")) Then 
    CType(lstView.FindControl("pnlFooter"), Panel).Attributes("CssClass")="RPT_footer"%>

I need to apply the cssClass "RPT_footer" only when the last vehicle record/row is being placed into the lstView so that the footer appears at the bottom of the page.

CSS: (.RPT_footer { position: absolute; bottom: 0; width:100%; } ).

Any suggestions will be very welcome.

2 Answers 2

1

If you would like to set cssclass on client side use for example java script or jquery function. In this solution you must set OnClientClick attribute on webcontrols with behaviour which actually changing panel style. If you prefer set on server side look for this question.

Sign up to request clarification or add additional context in comments.

Comments

1

Try this:

CType(lstView.FindControl("pnlFooter"), Panel).CssClass="RPT_footer"

or:

CType(lstView.FindControl("pnlFooter"), Panel).Attributes.Add("class","RPT_footer")

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.