LinkButton and Load

  • Thread starter =?ISO-8859-1?Q?J=F6rn_Ipsen?=
  • Start date
?

=?ISO-8859-1?Q?J=F6rn_Ipsen?=

Hi everyone,
i have composed an ascx page with two panels inside. The first panel is
set to invisble when the page loads. in the second panel there is a
linkbutton which should set the second panel on click event to visible.

now when the button is clicked the page reloads and does not show ( set
the second panel) to visible

i used the following Code:

private void Page_Load(object sender, System.EventArgs e)
{
Panel2.Visible = false;
}

private void LinkButton_Click(object sender, System.EventArgs e)
{
Panel2.Visible = true;

TextBox1.Width = Unit.Percentage(90);
TextBox2.Width = Unit.Percentage(90);
TextBox3.Width = Unit.Percentage(90);
TextBox4.TextMode = TextBoxMode.MultiLine;
TextBox4.Height = Unit.Pixel(150);
TextBox4.Width = Unit.Percentage(90);
TextBox5.Text = "(falls vorhanden)";
TextBox5.Font.Italic = true;
}

what is the Problem?

Ciao
Jörn
 
G

Guest

Try:

private void Page_Load(object sender, System.EventArgs e)
{
if (!IsPostBack)
{
Panel2.Visible = false;
}
}

HTH,
Jorge
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top