Click here to Skip to main content
15,896,063 members
Home / Discussions / ASP.NET
   

ASP.NET

 
GeneralRe: Enumurate Datagrid Rows Pin
Paddy Boyd17-Jan-08 1:37
Paddy Boyd17-Jan-08 1:37 
GeneralUnauthorisation error... Pin
koolprasad200316-Jan-08 22:50
professionalkoolprasad200316-Jan-08 22:50 
Questionhow to create print command in list view control Pin
Ravi_2116-Jan-08 22:40
Ravi_2116-Jan-08 22:40 
Questionhow to create administrator username and password? Pin
Basheer16-Jan-08 22:18
Basheer16-Jan-08 22:18 
GeneralRe: how to create administrator username and password? Pin
Colin Angus Mackay17-Jan-08 0:33
Colin Angus Mackay17-Jan-08 0:33 
Questionusing datagrid Pin
Harikrk16-Jan-08 21:32
Harikrk16-Jan-08 21:32 
GeneralRe: using datagrid Pin
_AK_17-Jan-08 19:00
_AK_17-Jan-08 19:00 
QuestionHow to create a table for Placeholder controls Pin
Albert8316-Jan-08 21:26
Albert8316-Jan-08 21:26 
Hello,
I have created a placeholder to will contain labels and textboxes based on the users choice from a dropdown. I would like to place every label and textbox in a seperate td in a table. How can I create a td for every label and textbox? Thanks.

Here is part of the code:

<asp:DropDownList ID="NumOfQuestionsDropDown" runat="server" AutoPostBack="True" OnSelectedIndexChanged="NumOfQuestionsDropDown_SelectedIndexChanged" >

</asp:DropDownList>
<asp:PlaceHolder ID="PlaceHolder1" runat="server"></asp:PlaceHolder>

void CreateLabelsTextBoxes()
{
int n = Int32.Parse(NumOfQuestionsDropDown.SelectedItem.Value);

// create n Labels and TextBoxes, and add them to the PlaceHolder TextBoxesHere
for (int i = 0; i < n; i++)
{
PlaceHolder1.Controls.Add(new Label());
PlaceHolder1.Controls.Add(new TextBox());
}
// Set the Text property of each Label
IterateThroughChildren(this);
}
void IterateThroughChildren(Control parent)
{
int count = 1;
foreach (Control c in parent.Controls)
{
if (c.GetType().ToString().Equals("System.Web.UI.WebControls.Label") && c.ID == null)
{
((Label)c).Text = "Question" + count;
count++;
}
Response.Write("Type= " + c.GetType() + "<br />");

if (c.Controls.Count > 0)
{
IterateThroughChildren(c);
}
}
}
protected void NumOfQuestionsDropDown_SelectedIndexChanged(object sender, EventArgs e)
{
CreateLabelsTextBoxes();
}
Questiondate query Pin
Pankaj Garg16-Jan-08 20:49
Pankaj Garg16-Jan-08 20:49 
GeneralRe: date query Pin
Colin Angus Mackay17-Jan-08 0:16
Colin Angus Mackay17-Jan-08 0:16 
NewsRe: date query Pin
Pankaj Garg17-Jan-08 2:04
Pankaj Garg17-Jan-08 2:04 
GeneralRe: date query Pin
dilipv17-Jan-08 21:47
dilipv17-Jan-08 21:47 
GeneralConvert DataTable in XML Pin
mpavas16-Jan-08 20:32
mpavas16-Jan-08 20:32 
GeneralPersistent Checkbox Pin
danasegaranea16-Jan-08 19:34
danasegaranea16-Jan-08 19:34 
GeneralRe: Persistent Checkbox Pin
N a v a n e e t h16-Jan-08 21:27
N a v a n e e t h16-Jan-08 21:27 
GeneralRe: Persistent Checkbox Pin
danasegaranea16-Jan-08 21:48
danasegaranea16-Jan-08 21:48 
GeneralRe: Persistent Checkbox Pin
N a v a n e e t h16-Jan-08 22:05
N a v a n e e t h16-Jan-08 22:05 
GeneralRe: Persistent Checkbox Pin
danasegaranea16-Jan-08 22:29
danasegaranea16-Jan-08 22:29 
GeneralRe: Persistent Checkbox Pin
N a v a n e e t h16-Jan-08 23:59
N a v a n e e t h16-Jan-08 23:59 
GeneralLoop through the rows of datagridview Pin
danasegaranea16-Jan-08 19:31
danasegaranea16-Jan-08 19:31 
GeneralRe: Loop through the rows of datagridview Pin
_AK_17-Jan-08 18:58
_AK_17-Jan-08 18:58 
Questionhow to make the droplist items to disabled Pin
jagan12316-Jan-08 19:11
jagan12316-Jan-08 19:11 
AnswerRe: how to make the droplist items to disabled Pin
pmarfleet16-Jan-08 19:48
pmarfleet16-Jan-08 19:48 
AnswerRe: how to make the droplist items to disabled Pin
imagic16-Jan-08 20:42
imagic16-Jan-08 20:42 
Generaldeveloping website with hindi and english language support Pin
Ravi_2116-Jan-08 18:27
Ravi_2116-Jan-08 18:27 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.