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

  • Home
  • SEARCH
  • 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 974373
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 16, 20262026-05-16T03:25:37+00:00 2026-05-16T03:25:37+00:00

<asp:Repeater ID=repFilter runat=server> <HeaderTemplate> <div id=posting align=center> </HeaderTemplate> <ItemTemplate> <div class=friends_area id=record-> <%# ((Alert)Container.DataItem).Message

  • 0
<asp:Repeater ID="repFilter" runat="server">
                        <HeaderTemplate>
                            <div id="posting" align="center">
                        </HeaderTemplate>

                        <ItemTemplate>
                            <div class="friends_area" id="record-">
                                <%# ((Alert)Container.DataItem).Message %>
                                <asp:Literal Visible="false" ID="litAlertId" Text='<%# ((Alert)Container.DataItem).AlertId %>' runat="server"></asp:Literal>
                                <Company:Comments ID="Comments1" SystemObjectRecordId='<%# ((Alert)Container.DataItem).AlertId %>' runat="server" SystemObjectId="7"></Company:Comments>
                            </div>
                        </ItemTemplate>

                        <FooterTemplate>
                            </div>
                        </FooterTemplate>
                    </asp:Repeater>

I am having a problem setting the SystemObjectRecordID attribute of my custom control inside a repeater. Currently, the value winds up as zero in the database. Things I have checked / worth pointing out:

1) AlertId is an Primary Key Identity column in the database and the table has numerous rows so AlertId should be returning multiple values.

2) The datatype of the DB column (bigint) and the datatype of AlertId (long) and the datatype of the getter/setter SystemObjectRecordID variable (long) match.

3) If I set ‘<%# ((Alert)Container.DataItem).AlertId %>’ to the Text attribute of a literal I get the expected results. So, it has something to do with my custom control and specifically how data is bound to the SystemObjectRecordID attribute.

4) If I change SystemObjectRecordID from long to string and then do ((Alert)Container.DataItem).AlertId.ToString() the value I get for SystemObjectRecordId in debug is null (but it still works when assigned to the text attribute of a literal).

5) The location of the User Control is default.aspx and the control is comments.ascx. The code files do not share a namespace.

6) I have tried manipulating the OnItemDataBound property of my repeater but since I have proven with the literal that data is getting bound using a declarative value I am not sure what else I could be doing inside the method logic of OnItemDataBound.

Once the end-user makes a comment in the UI, the SystemObjectRecordId value (which should have already been assigned when the page loaded – and we know it does in the case of the literal) should get passed to the codebehind of the custom usercontrol:

namespace Company.ProjectWeb.UserControls
{
    public partial class Comments : UserControl, IComments
    {
        private readonly IUserSession _userSession;
        private CommentsPresenter _presenter;
        public int SystemObjectId { get; set; }
        public long SystemObjectRecordId { get; set; }

No matter what I do, I always get zero for SystemObjectRecordId when passed via the custom user control I have on my default.aspx page. I am out of ideas – could use some suggestions at this point. Thanks.

  • 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-16T03:25:38+00:00Added an answer on May 16, 2026 at 3:25 am

    OK, I have figured out a work-around for this by adding SystemObjectRecordId to the ViewState:

    public long SystemObjectRecordId
            {
                get
                {
                    if (ViewState["SystemObjectRecordId"] != null)
                        return long.Parse(ViewState["SystemObjectRecordId"].ToString());
                    else
                        return 0;
                }
                set
                {
                    ViewState["SystemObjectRecordId"] = value;
                }
            }
    

    Its not idea, but it works. I still don’t get why I can’t set the declarative value as previously specified but this will have to do for now.

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

Sidebar

Related Questions

aspx file: <asp:Repeater ID=Repeater_sorular runat=server> <HeaderTemplate> </HeaderTemplate> <ItemTemplate> <div class=div_soru> <div class=div_soru_wrapper> <%#Eval(Subject)%> <asp:RadioButtonList
Instead of the default Im using <asp:Repeater runat=server ID=MenuRepeater DataSourceID=topSiteMap> <HeaderTemplate> <div class=arrowlistmenu> </HeaderTemplate>
This is my code : <asp:Repeater runat=server ID=rpUbicazione> <ItemTemplate> <div class=Field style=margin-bottom:20px;> // elements
I have this repeater: <asp:Repeater ID=rptContentPageGetAll runat=server OnLoad=rptContentPagesGetAll_Load> <HeaderTemplate> <ul class=contentPageTree> </HeaderTemplate> <ItemTemplate> <li><%#
<asp:Repeater id=rptExcelField runat=server> <HeaderTemplate> <table style=width:100%; id=mainTable> </HeaderTemplate> <ItemTemplate> <tr> <td class=style1> <asp:Label ID=lblField
I have a repeater: <asp:Repeater ID=rpt_Items OnItemCommand=rpt_Items_ItemCommand runat=server> <ItemTemplate> <div class=item> <div class=fr> <asp:TextBox
Repeater markup: <asp:Repeater ID=Repeater_sorular runat=server OnItemCommand=Repeater_sorular_ItemCommand OnItemDataBound=Repeater_sorular_ItemBound> <HeaderTemplate> </HeaderTemplate> <ItemTemplate> <table> <tr> <td> <rad:RadChart
repeater code: <asp:Repeater ID=Repeater_sorular runat=server OnItemCommand=Repeater_sorular_ItemCommand OnItemDataBound=Repeater_sorular_ItemBound> <HeaderTemplate> </HeaderTemplate> <ItemTemplate> <table> <tr> <td> <rad:RadChart
I have a repeater like this: <asp:Repeater runat=server ID=pde> <HeaderTemplate></HeaderTemplate> <ItemTemplate> <asp:Literal runat=server ID=literal1></asp:Literal>
I have Repeater Control as shown below. <asp:Repeater ID=rptCategory runat=server> <HeaderTemplate> <h2 class=art-logo-text style=margin-bottom:

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.