Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7606805
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 31, 20262026-05-31T00:30:07+00:00 2026-05-31T00:30:07+00:00

Probably a doh moment, but can’t get this codebehind function to fire. In fact

  • 0

Probably a “doh” moment, but can’t get this codebehind function to fire. In fact debugging shows it’s not even being called, which may be indicative when finally displayed on the web page, one only sees:

<table id="dnn_ctr422_ViewPloads_PagerTable">.... 

Notice the missing “style”. ANY help would be greatly appreciated.

//aspx code
<table id="PagerTable" style="<%# GetPagerStyle() %>" runat="server">
   <tr>
   <td> 
      <asp:DataPager ID="PloadPager" runat="server" PagedControlID="PloadListView" OnPreRender ="PloadPager_PreRender" PageSize="20" >

//code behind      
protected String GetPagerStyle( )
    {
        return "background-color:" + (String)Settings["TableBackgroundColor"];
    }
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-31T00:30:08+00:00Added an answer on May 31, 2026 at 12:30 am

    From what you show it is not clear why it isn’t run. It is possible that you run against a version that is not equal to your source, but I assume you already tried a full rebuild.

    Know that you can set breakpoints in the ASPX page as well. But my hunch is that if this isnt’t called, more isn’t called. Have you tried breaking on Page_Load or Page_PreRender?

    Another possibility is that your PagerTable object is changed by other code prior to GetPagerStyle being called. In that case, if the style-attribute is altered before it is run may yield this problem. A workaround and to find out whether you actually can set the style is to do the following in Page_Load:

    // correction courtesy of Tim Schmelter ;)
    PagerTable.Style.Add(HtmlTextWriterStyle.BackgroundColor, 
        (String)Settings["TableBackgroundColor"]);
    

    EDIT: Note, as others have pointed out, the following should also work (tried it, as there was some controversy, see other answers):

    <table id="PagerTable" style="<%= GetPagerStyle() %>">
    

    However, note that I removed the runat="server". That means, you cannot use it from the code-behind anymore. I’m just assuming you’re not doing anything else with this control in the code-behind, so whether this works for your situation I don’t know.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

The answer to this question will probably give me a doh! moment, but where
Probably this will not result in any noticable performance difference, but I was just
Probably a simple question this, but... I can apply CSS to all images using
probably a silly question, but I'm not sure how to handle this 'correct'. I
Probably for someones this question is trivial but i can't remember which is the
Probably this question repeated, but i am not satiesfied with existing answers. I want
Probably a dumb thing to ask, but this will really help me get my
Probably really easy for a pro, but could someone re-write this from it's PHP
Probably a conceptual mistake from my part but let's say I have a function
Probably not the best title I've ever written, but I find it hard to

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.