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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 28, 20262026-05-28T06:13:16+00:00 2026-05-28T06:13:16+00:00

I have an input field that is appended to the HTML in a div.

  • 0

I have an input field that is appended to the HTML in a div.
I need to have this input field bound to the ctrlmenuItems in the system but I don’t know how.

I have this function which is the one calling the object:

protected void btnSave_Click(object sender, EventArgs e){
  int Id = int.Parse(Request.QueryString["edit"]);
  DA.page itmToEdit = DA.page.StaticGetById(Id);
  itmToEdit.title = ctrltitle.Text;
        itmToEdit.menuItems = ctrlmenuItems.Text;
  itmToEdit.content = ctrlcontent.Text;
  itmToEdit.Update();
  UpdateGUI();
  pnlEditArea.Visible = false;
}

I tried using:

protected global::System.Web.UI.WebControls.TextBox ctrlmenuItems;

which just creates a null reference.

I tried calling this onInit():

TextBox ctrlmenuItems = new TextBox();
ctrlmenuItems.ID = "ctrlmenuItems";
ctrlmenuItems.Text = "Enter your name";
this.form1.Controls.Add(ctrlmenuItems);

with no luck.

The appending is done like this:

litMenu.Text += string.Format(@"<div>
      <a class='button' href='?del={1}'>Slet</a>
      <input name='ctrlmenuItems' type='text' id='ctrlmenuItems' value'{0}' />
    </div>",
  itm.menuItems,
  itm.id);

I need to be able to click “save” and it passes on the value from the textField to dataAccess
but I can’t figure out how to bind this “virtual” textbox correctly.

  • 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-28T06:13:16+00:00Added an answer on May 28, 2026 at 6:13 am

    input tags with a name attribute will be stored in the Request.Form array when the page posts back.

    Whether you add the TextBox control manually, or simply insert the corresponding HTML (which I would not recommend, building HTML via string concatenation makes it very easy to yield invalid HTML), you can retrieve the value when your button is clicked using the following:

    string value = Request.Form["ctrlmenuItems"];
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have an input field that is appended to a div tag through a
I have an input field that was written with onfocus=this.value='' , but recently decided
I have a jQuery jPicker colorpicker that is bound to an input text field
I have an input field that is rendered with a template like so: <div
I have an input field that looks like this: <input id=test value=abdefg /> I
I have an HTML input field that I want the user to be able
I have an input field that saves a URL, I'd like this saved input
I have an input field that is by default set to type=text so that
I have a dijit.form.NumberTextBox input field that starts out with these parms: new dijit.form.NumberTextBox({
I hope I can explain this right I have two input fields that require

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.