473,322 Members | 1,778 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,322 software developers and data experts.

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(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
Jul 21 '05 #1
1 1178
Try:

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

HTH,
Jorge
"Jörn Ipsen" wrote:
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

Jul 21 '05 #2

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

3
by: Kiyomi | last post by:
Hello, I create a Table1 dynamically at run time, and at the same time, I would like to create LinkButton controls, also dynamically, and insert them into each line in my Table1. I would...
5
by: Fresh Air Rider | last post by:
Hello Could anyone please explain how I can pass more than one arguement/parameter value to a function using <asp:linkbutton> or is this a major shortfall of the language ? Consider the...
0
by: Pat Sagaser via .NET 247 | last post by:
I'm trying to add LinkButtons to a Repeater control using adynamic template. The docs state that you should be able tobubble the click event to the containing Repeater. There areplenty of examples in...
10
by: Bharat | last post by:
Hi Folks, Suppose I have two link button on a page (say lnkBtn1 and lnkBtn2). On the click event of the lnkbtn1 I have to add a dynamically created control. And On the click event of the lnkBtn2 I...
10
by: Vi | last post by:
Hi, I'm trying to dinamically add LinkButton Controls to a web form. I do something like: for(i=1;i<=someVariable;i++) { LinkButton PageLink = new LinkButton(); PageLink.CommandName =...
1
by: JeffP | last post by:
I need to know when a link buttons value is zero so I don't try to run a query to find none. When I was using ViewState(ds_Last), which I can't do because certain phones are choking on the data,...
2
by: WolfyUK | last post by:
Hello, I have a standard asp:DataGrid called CasesGrid that I wish to write my own paging controls for. The aim is to get something like the following rendered to screen: << First < Previous...
13
by: rn5a | last post by:
In a shopping cart app, suppose a user has placed 5 orders, I want to show him 5 LinkButtons (one for each order) so that when he clicks the first LinkButton, he would be shown the details of his...
3
by: Ben | last post by:
Hi, i try to reach in code-behind a linkbutton embedded into an ItemTemplate element of a gridview. But i'm stuck .... <Columns> <asp:TemplateField><ItemTemplate> <asp:LinkButton ID="lb1"...
0
by: HillBilly | last post by:
MasterPages again. Three LinkButtons are being used as styled tabs in the content page that will load a different ListView when a tab is selected: TabA, TabB or TabC. The LinkButtons are declared...
0
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
1
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: ArrayDB | last post by:
The error message I've encountered is; ERROR:root:Error generating model response: exception: access violation writing 0x0000000000005140, which seems to be indicative of an access violation...
1
by: PapaRatzi | last post by:
Hello, I am teaching myself MS Access forms design and Visual Basic. I've created a table to capture a list of Top 30 singles and forms to capture new entries. The final step is a form (unbound)...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
1
by: Defcon1945 | last post by:
I'm trying to learn Python using Pycharm but import shutil doesn't work
1
by: Shællîpôpï 09 | last post by:
If u are using a keypad phone, how do u turn on JavaScript, to access features like WhatsApp, Facebook, Instagram....
0
by: af34tf | last post by:
Hi Guys, I have a domain whose name is BytesLimited.com, and I want to sell it. Does anyone know about platforms that allow me to list my domain in auction for free. Thank you
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.