TECHNOLOGIES
FORUMS
JOBS
BOOKS
EVENTS
INTERVIEWS
Live
MORE
LEARN
Training
CAREER
MEMBERS
VIDEOS
NEWS
BLOGS
Sign Up
Login
No unread comment.
View All Comments
No unread message.
View All Messages
No unread notification.
View All Notifications
Answers
Post
An Article
A Blog
A News
A Video
An EBook
An Interview Question
Ask Question
Forums
Monthly Leaders
Forum guidelines
akash singh
NA
122
73.4k
PLZ..RESOLVE IT... ITS URGENT
Dec 29 2014 6:19 AM
using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
public partial class TEXT1 : System.Web.UI.Page
{
protected void Page_Load(object sender, EventArgs e)
{
/* Label lbl;
TextBox txt;
for (int i = 0; i <= 3; i++)
{
lbl = new Label();
txt = new TextBox();
lbl.Text = "Label" + (i).ToString() + " ";
// txt.Text = "TextBox" + (i).ToString();
lbl.ID = "Label" + i.ToString();
txt.ID = "TextBox" + i.ToString();
txt.EnableViewState = true;
Panel1.Controls.Add(lbl);
Panel1.Controls.Add(txt);
//_textBoxes.Add(txt);
Panel1.Controls.Add(new LiteralControl("<br /><br />"));
}*/
//divText.InnerText
}
protected void Button1_Click(object sender, EventArgs e)
{
foreach (Control c in Panel1.Controls)
{
if (!string.IsNullOrEmpty(c.ID))
{
if (c.ID.ToLower().Contains("label"))
{
lblMessage.Text += ((Label)c).Text + ":";
}
if (c.ID.ToLower().Contains("text"))
{
if (!string.IsNullOrEmpty(((TextBox)c).Text))
{
lblMessage.Text += ((TextBox)c).Text + ",";
}
}
}
}
}
protected void ListBox2_SelectedIndexChanged(object sender, EventArgs e)
{
Label lbl;
TextBox txt;
for (int i = 0; i <= 3; i++)
{
lbl = new Label();
txt = new TextBox();
lbl.Text = "Label" + (i).ToString() + " ";
// txt.Text = "TextBox" + (i).ToString();
lbl.ID = "Label" + i.ToString();
txt.ID = "TextBox" + i.ToString();
txt.EnableViewState = true;
Panel1.Controls.Add(lbl);
Panel1.Controls.Add(txt);
//_textBoxes.Add(txt);
Panel1.Controls.Add(new LiteralControl("<br /><br />"));
}
}
WHEN THE CODE INSIDE ListBox2_SelectedIndexChanged FUNCTION PUT IN PAGELOAD FUNCTION.. VALUE OF TEXT BOX SHOW... BT WHEN USED IN ListBox2_SelectedIndexChanged
..VALUE OF TEXT BOX DOESNT SHOW..WHY
Reply
Answers (
4
)
How to develop a website to support all screen resolutions?
Communication between Windows Service and ASP.Net WebApp