Click here to Skip to main content
15,893,814 members

Comments by Sugu Thomas (Top 5 by date)

Sugu Thomas 14-Jul-13 10:34am View    
Yes, I was palnning to do that....I think that is the only way.....Thank you,@Zafar....
Sugu Thomas 13-Jul-13 13:28pm View    
I am not screaming......
Sugu Thomas 12-Jul-13 19:39pm View    
Thank you once again for supporting... Your code is working and i enabled the viewstate = true for my dynamic label and textbox...

here is my full code:

The `lnkcat` is the linkbutton for Category and `lnksubcat` is the link button for Sub-category:

public partial class Products : System.Web.UI.Page
{
public static Label lblCat,lblSubcat;
public static TextBox txtCat, txtSubCat;

string _Cat;// stores new Sub cat
string _SubCat;

protected void lnkCat_Click(object sender, EventArgs e)
{

Panel2.Visible = false;
Panel1.Visible = true;

lblCat = new Label();
lblCat.Text = "Enter new Category: ";
PHcat.Controls.Add(lblCat);
lblCat.EnableViewState = true;

txtCat = new TextBox();
_Cat = txtCat.Text;
PhtxtCat.Controls.Add(txtCat);

}

protected void lnkSubCat_Click(object sender, EventArgs e)
{
Panel1.Visible = true;
Panel2.Visible = true;

lblSubcat = new Label();
lblSubcat.Text = "Enter new Sub-Category: ";
PHsubCat.Controls.Add(lblSubcat);

txtSubCat = new TextBox();
_SubCat = txtSubCat.Text;
PhtxtSubCat.Controls.Add(txtSubCat);
}
}

Here my problem again is when i click on 'Create Category' link button (lnkCat_Click) dynamically its label and textbox is displayed for category and i have another link button for creating 'SuB-category' and when i click (lnkSubCat_Click) on that button for 'Create Sub category' THE FIRST DYNAMIC CREATED (FOR CATEGORY) LABEL AND TEXTBOX ARE REMOVED. HERE I WANT TO HOLD THAT DYNAMIC CREATED(CAT AND SUB-CAT) SHOULD BE DISPLAYED TILL I CLICK ON SUBMIT BUTTON ON THE SAME PAGE!

I have two create link button to create cat and sub-cat!

CAN U PLEASE HELP ON THIS MATTER? AND IS THIS POSSIBLE?

THANK YOU...EXPECTING A REPLY!
Sugu Thomas 12-Jul-13 0:27am View    
Ok, Manu, i will check it....Thank you for the response.... Actually i forgot to put my code.. I placed a place holder for these 2 texboxes....
Sugu Thomas 10-Jul-13 19:25pm View    
Thank you @sergey....valuable information!!