473,395 Members | 1,521 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,395 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 1181
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
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...

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.