473,394 Members | 2,168 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,394 software developers and data experts.

PlaceHolder Issue

Hey every body;

first off let me say thanks every body..this place is great i have never
came here with a problem and left without an answer..you guys are awsome

any way i had a question rather a problem then a question

i am using a placeholder control in my webform this control
programmically loads up a custom control, the control that it loads up
is a asp.net 2.0 wizard...now here is aproblem,
the control loads up no problem, but the issue is that once the the next
button has been clicked on the wizard and the page refreshes, the
control goes away. i think the place holder unloads the control for
somereason....so the user will never get to step 2 of the wizard....

any suggestion why is this happneing and how can i pervent it ?

thanks in advance
---
Best Regards
Amir

*** Sent via Developersdex http://www.developersdex.com ***
Nov 19 '05 #1
1 1565
Amir:
Dynamically added controls aren't automatically reloaded on postback.
Viewstate only holds control information, not the actual control itself.
You need to reload the control...and in order for it's event to fire
properly, you need to do it pretty early in the page lifecycle..typically on
onInit, but I think onLoad will work also. Oftentimes, people will put an
array of strings in the viewstate (which contain a list of dynamically added
controls), on postback retrieve the list of strings from viewstate and
reload the controls.

As an alternative, you can use Denis Bauer's Free Dynamic PlaceHolder
control which takes care of all this for you (ie, it recreates the controls
on postback)
http://www.denisbauer.com/ASPNETCont...aceholder.aspx

Karl
--
MY ASP.Net tutorials
http://www.openmymind.net/ - New and Improved (yes, the popup is annoying)
http://www.openmymind.net/faq.aspx - unofficial newsgroup FAQ (more to
come!)
"Amir Ghezelbash" <am*****@rogers.com> wrote in message
news:OP****************@TK2MSFTNGP14.phx.gbl...
Hey every body;

first off let me say thanks every body..this place is great i have never
came here with a problem and left without an answer..you guys are awsome

any way i had a question rather a problem then a question

i am using a placeholder control in my webform this control
programmically loads up a custom control, the control that it loads up
is a asp.net 2.0 wizard...now here is aproblem,
the control loads up no problem, but the issue is that once the the next
button has been clicked on the wizard and the page refreshes, the
control goes away. i think the place holder unloads the control for
somereason....so the user will never get to step 2 of the wizard....

any suggestion why is this happneing and how can i pervent it ?

thanks in advance
---
Best Regards
Amir

*** Sent via Developersdex http://www.developersdex.com ***

Nov 19 '05 #2

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

Similar topics

1
by: chak | last post by:
I have developed a form which dynamically builds textbox, radiobuttonlist, checkboxlist controls from parameters in a table, and somehow manages to maintain state (of data keyed in by user)....
2
by: Mike Speak | last post by:
I have a user control that I want to use to render 4 menu items (retrieved from db) on the top of each of my asp.net pages. The user control defines a table, with one TR and one TD. Within the...
2
by: Chad Crowder | last post by:
Is it possible to create a placeholder inside a template column of a datagrid? My goal is to use a placeholder, and during runtime add user controls to the placeholder as the items in the datagrid...
0
by: shark | last post by:
I have a placeholder in a control that is in turn, used as a control in a placeholder in a form. I am getting a viewstate error so I believe I have to clear my placeholder before I load the...
1
by: Angel | last post by:
I have added controls to the placeholder control. All the controls that were added have EnableViewState = true including the placeholder. One of the controls has a button that performs a postback. My...
2
by: tma | last post by:
How do I reference controls added via the placeholder control in my codebehind file? For example, my placeholder adds a checkbox with an id="chkGear". How do I test for the checkstate of chkgear...
9
by: Anders K. Jacobsen [DK] | last post by:
Hi I have this that adds some usercontrol (UCTodays.ascx) to a placeholder foreach(A a in B){ UCTodays ucline = (UCTodays )LoadControl("UCTodays.ascx");...
3
by: ilockett | last post by:
The background: I have a web app with a simple master page that contains just one content placeholder. I have created a web form that then uses this master page. Within the content...
6
by: David Colliver | last post by:
Hi, using vb.net 1.1 I am trying to add a control to a placeholder but am having problems with it. I do it practically the same way as i do in C# (I have more C# skill than VB.NET)and I...
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
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
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
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
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
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.