I'm sorry in advance if this seems to be a beginners question and wasted some of your time, but it does really bother me and I would really appreciate it if someone could help.

I'm simply creating a "zone" if you will, where the user inputs a word/sentence which are tasks, and then can check if the task was completed or not and/or if the word/sentence needs to be changed.

So in the end, what I need is a textbox lets say where the user inputs a specific number supposed x, and generates x times this div.

Here is the code (unfortunately I could not post pics since I do not have enough reputation..)

ASP.NET code

<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="WebForm1.aspx.cs" Inherits="GMode.tiz.WebForm1" %>

<!DOCTYPE html>

<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
    <title>whatevz</title>
    <link href="StyleSheet1.css" rel="stylesheet" />
    <script src="../jquery-1.11.3.min.js"></script>
    <script src="../functions.js"></script>


</head>
<body>
    <form id="form1" runat="server">

        <div class="singleContainer">
            <div class="lblPlace">
                <asp:Label ID="lbl" runat="server" Text="Input Task"></asp:Label>
                <asp:TextBox ID="hi" CssClass="txtBox" runat="server"></asp:TextBox>
            </div>
            <asp:Button ID="save" runat="server" CssClass="UniversalBtn" OnClick="btnCheck_Click" />
            <asp:Button ID="cancel" runat="server" CssClass="UniversalBtn" OnClick="btnCancel_Click" />
            <asp:Button ID="edit" runat="server" CssClass="UniversalBtn" />
            <asp:Button ID="submit" runat="server" CssClass="BtnSubmit" OnClick="btnSubmit_Click" Text="DONE"/>
        </div>


    </form>
</body>
</html>

C# code

using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;

namespace GMode.tiz
{
    public partial class WebForm1 : System.Web.UI.Page
    {
        protected void Page_Load(object sender, EventArgs e)
        {

        }

        protected void btnCheck_Click(object sender, EventArgs e)
        {
            lbl.CssClass = "done";
        }

        protected void btnCancel_Click(object sender, EventArgs e)
        {
            lbl.CssClass = "undone";
        }

        protected void btnSubmit_Click(object sender, EventArgs e)
        {
            if (hi.Text == "")
            {
                lbl.Text = "No Value";
            }
            else
            {
                lbl.Text = hi.Text;
            }
        }

    }
}

So basically I want to dynamically create <div class="singleContainer"> with everything inside it x times (x defined by the user). Please tell me if you need more of the code. There are still the css and js files that I did not post.

Thank you, Jack

Related posts

Recent Viewed