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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 3, 20262026-06-03T17:43:05+00:00 2026-06-03T17:43:05+00:00

I add these hidden input fields into a panel : foreach (Object obj in

  • 0

I add these hidden input fields into a panel :

foreach (Object obj in Objects)
{
    HiddenField hf = new HiddenField();
    hf.Value = "";
    hf.ID = "categoria" + obj.ID;
    panelCategorieGuida.Controls.Add(hf);
}

but, around each hidden fields, I need to add this code :

<div class="option-box"><a href="javascript:void(0);" class="option-box-item">&nbsp;</a>
    <span class="option-box-testo">Hello</span>
    <!-- HERE I NEED TO PUT THE HIDDEN FIELD i, so think to this whole option-box item into a cycle -->
</div>

I’d like to avoid to write Literal on the cs and add them into the panel.

What can you suggest to me?

  • 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-06-03T17:43:06+00:00Added an answer on June 3, 2026 at 5:43 pm

    You could use Repeater control, markup :

    <asp:Repeater ID="catRep" runat="server" onitemcreated="catRep_ItemCreated">
      <ItemTemplate>
        <div class="option-box"><a href="javascript:void(0);" class="option-box-item">&nbsp;</a>
          <span class="option-box-testo">Hello</span>
          <asp:PlaceHolder ID="hiddenPlaceHolder" runat="server"></asp:PlaceHolder>          
        </div>
      </ItemTemplate>
    </asp:Repeater>
    

    code behind :

    protected void catRep_ItemCreated(object sender, RepeaterItemEventArgs e)
    {
      Control placeHolder = e.Item.FindControl("hiddenPlaceHolder");
      if (placeHolder != null)
      {
        MyItemClass my = (MyItemClass)e.Item.DataItem;
        HiddenField hf = new HiddenField();
        hf.Value = "";
        hf.ID = "categoria" + my.ID;
        placeHolder.Controls.Add(hf);
      }
    }
    

    Of course you will have to bind repeater with Objects list

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

Sidebar

Related Questions

There is a one section of orders page where users can add new fields
I'm working a form builder interface for users to add various input fields, and
I have a form with several input fields for a User to add their
I have a form with some fields in it: <form id=unit> <input type=hidden name=item_id
There is a one section of orders page where users can add new fields
Entity Framework has created the required partial classes. I can add these partial classes
http://www.foobar.com/foo/foo_bar.html?id=abc12A63768adv http://www.foobar.com/foo/foo_bar.html?id=gsdfcc6tfsdfgg http://www.foobar.com/foo/foo_bar.html?id={8765ABDV-8876-CR56-654A-ADD} These are the url pattern for which I have to write
How do you add code to these events for native c++? I couldn't find
I have these Views on which I add UILabels as text, The Views can
When I add either one of these ... <%@ OutputCache Duration="600" Location="Any" VaryByParam="*" %>

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.