Click here to Skip to main content
15,921,577 members
Home / Discussions / ASP.NET
   

ASP.NET

 
Questioncrystal report formula field Pin
Pankaj Garg17-Jan-08 1:56
Pankaj Garg17-Jan-08 1:56 
QuestionAutoincrement column Pin
mpavas17-Jan-08 1:54
mpavas17-Jan-08 1:54 
GeneralRe: Autoincrement column Pin
Not Active17-Jan-08 2:16
mentorNot Active17-Jan-08 2:16 
GeneralRe: Autoincrement column Pin
mpavas17-Jan-08 2:28
mpavas17-Jan-08 2:28 
GeneralRe: Autoincrement column Pin
Not Active17-Jan-08 2:50
mentorNot Active17-Jan-08 2:50 
Questionerror in my vb.net application Pin
Ravi_2117-Jan-08 1:18
Ravi_2117-Jan-08 1:18 
GeneralRe: error in my vb.net application Pin
dilipv17-Jan-08 21:39
dilipv17-Jan-08 21:39 
GeneralEnumurate Datagrid Rows [modified] Pin
danasegaranea17-Jan-08 0:57
danasegaranea17-Jan-08 0:57 
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 

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.