LinkButton and Load

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • Jörn Ipsen

    #1

    LinkButton and Load

    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(objec t sender, System.EventArg s e)
    {
    Panel2.Visible = false;
    }

    private void LinkButton_Clic k(object sender, System.EventArg s e)
    {
    Panel2.Visible = true;

    TextBox1.Width = Unit.Percentage (90);
    TextBox2.Width = Unit.Percentage (90);
    TextBox3.Width = Unit.Percentage (90);
    TextBox4.TextMo de = TextBoxMode.Mul tiLine;
    TextBox4.Height = Unit.Pixel(150) ;
    TextBox4.Width = Unit.Percentage (90);
    TextBox5.Text = "(falls vorhanden)";
    TextBox5.Font.I talic = true;
    }

    what is the Problem?

    Ciao
    Jörn
  • Jorge L Matos [MCSD.NET]

    #2
    RE: LinkButton and Load

    Try:

    private void Page_Load(objec t sender, System.EventArg s e)
    {
    if (!IsPostBack)
    {
    Panel2.Visible = false;
    }
    }

    HTH,
    Jorge


    "Jörn Ipsen" wrote:
    [color=blue]
    > 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(objec t sender, System.EventArg s e)
    > {
    > Panel2.Visible = false;
    > }
    >
    > private void LinkButton_Clic k(object sender, System.EventArg s e)
    > {
    > Panel2.Visible = true;
    >
    > TextBox1.Width = Unit.Percentage (90);
    > TextBox2.Width = Unit.Percentage (90);
    > TextBox3.Width = Unit.Percentage (90);
    > TextBox4.TextMo de = TextBoxMode.Mul tiLine;
    > TextBox4.Height = Unit.Pixel(150) ;
    > TextBox4.Width = Unit.Percentage (90);
    > TextBox5.Text = "(falls vorhanden)";
    > TextBox5.Font.I talic = true;
    > }
    >
    > what is the Problem?
    >
    > Ciao
    > Jörn
    >[/color]

    Comment

    Working...