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 6838041
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 26, 20262026-05-26T23:32:57+00:00 2026-05-26T23:32:57+00:00

I’ve been experimenting with this and trying to understand the Page Life Cycle for

  • 0

I’ve been experimenting with this and trying to understand the Page Life Cycle for hours upon hours. I’m completely stumped at this point :'( Any help would be GREATLY appreciated.

Below are my methods. My _PrefillWizard method actually works for all the controls on my page except for those which are dynamically populated. The CheckBoxLists are such because they are automatically generated based on selectable values in a table in my DB. I already have this control in my markup like so… how do I force this to load and be ready before running my other code?

<asp:CheckBoxList ID="MyLanguagesCBL" runat="server" RepeatDirection="Vertical"
    RepeatColumns="4" Width="100%" DataSourceID="LanguagesSDS"
    DataTextField="Language" DataValueField="ID">
</asp:CheckBoxList>
<asp:SqlDataSource ID="LanguagesSDS" runat="server" 
    ConnectionString="<%$ ConnectionStrings:ConnectionString1 %>"
    SelectCommand="select ID, [Language] from LanguagesListTable"
    DataSourceMode="DataReader">
</asp:SqlDataSource>

Obviously these particular controls are not yet generated or on the page by the time my _PrefillWizard has been called, resulting in none of the CheckBoxes being pre-filled. How do I make them generate before my prefill method is called? Thanks 😉

The click event that kicks things off.

'On "Load" Button click, clears a Wizard control and Prefills it with the
'  data from the clicked record based on the primary key stored in SessionState.
Protected Sub RowClick(ByVal sender As Object, ByVal e As GridViewCommandEventArgs) Handles GridView2.RowCommand
    If e.CommandName = "Select" Then
        Session.Add("ClickedPrimaryKey", GridView2.DataKeys(e.CommandArgument).Value.ToString)
        'This is the main function which calls "_SetCheckBoxes" among others.
        _PrefillWizard(Session.Item("ClickedPrimaryKey"))
    End If
End Sub

Here’s my function for populating the my CheckBoxList control, but it obviously depends on the control having already been loaded on the page.

'Parse a CSV String from the Database back into CheckBoxList Selections
Protected Sub _SetCheckBoxes(ByRef cbl As CheckBoxList, ByRef dt As DataTable, ByVal row As Integer, ByVal csv As String)
    'Do something if there is a value in the cell
    If Not IsDBNull(dt.Rows.Find(row)(csv)) Then
        For Each item As ListItem In cbl.Items
            item.Selected = False 'Reset the checkbox first
            'Then, if the ID value of the checkbox corresponds to a value 
            '  in the CSV string, then tick the checkbox.
            If csv.Contains(item.Value) Then
                item.Selected = True
            End If
        Next
    End If
End Sub
  • 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-26T23:32:57+00:00Added an answer on May 26, 2026 at 11:32 pm

    You guys will probably get a kick out of this, but the answer was so obvious that I didn’t even catch it all this time. Of course I was preoccupied with about 10 other functions too >.<

    Here’s the answer. You’ll notice that in my _SetCheckBoxes method, I first checked to ensure that a value existed for the particular csv string, but also notice, that I failed to actually SET it to the corresponding value string afterward. This isn’t immediately apparent, but what I was actually passing in as csv was the name of the Column in my DataTable where the string actually lived.

    csv = dt.Rows.Find(row)(csv).ToString
    

    That line added immediately after my IsDBNull check, fixed my problem. 🙂

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

Sidebar

Related Questions

I have a jquery bug and I've been looking for hours now, I can't
I am trying to understand how to use SyndicationItem to display feed which is
Basically, what I'm trying to create is a page of div tags, each has
I have a string like this: La Torre Eiffel paragonata all&#8217;Everest What PHP function
I'm parsing an RSS feed that has an &#8217; in it. SimpleXML turns this
link Im having trouble converting the html entites into html characters, (&# 8217;) i
That's pretty much it. I'm using Nokogiri to scrape a web page what has
For some reason, after submitting a string like this Jack’s Spindle from a text
this is what i have right now Drawing an RSS feed into the php,
I have this code to decode numeric html entities to the UTF8 equivalent character.

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.