473,386 Members | 1,820 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,386 software developers and data experts.

PlaceHolder Disappears on Page PostBack

Hi all,

I have a placeholder control on an ASPX page. I
dynamically add a few button control and label control to the placeholder
from
code - all is well with the world. But on post back the
control disappears from the placeholder. Am I missing
something here
Please help

Vishal Gupta
Jun 1 '06 #1
2 3475
Hi,

You have to recreate them in the postback
--
--
Ignacio Machin,
ignacio.machin AT dot.state.fl.us
Florida Department Of Transportation
"Vishal Gupta" <vi**********@acs-inc.com> wrote in message
news:eo*************@TK2MSFTNGP03.phx.gbl...
Hi all,

I have a placeholder control on an ASPX page. I
dynamically add a few button control and label control to the placeholder
from
code - all is well with the world. But on post back the
control disappears from the placeholder. Am I missing
something here
Please help

Vishal Gupta

Jun 1 '06 #2
i think i found a better solution.. We can do in Page_init Method...

ASP.NET pages automatically bind page events to methods that have the name
Page_event. This automatic binding is configured by the AutoEventWireup
attribute in the @ Page directive, which is set to true by default. If you
set AutoEventWireup to false, the page does not automatically search for
methods that use the Page_event naming convention.
http://msdn2.microsoft.com/en-us/library/6w2tb12s.aspx
"Ignacio Machin ( .NET/ C# MVP )" <ignacio.machin AT dot.state.fl.us> wrote
in message news:u$**************@TK2MSFTNGP03.phx.gbl...
Hi,

You have to recreate them in the postback
--
--
Ignacio Machin,
ignacio.machin AT dot.state.fl.us
Florida Department Of Transportation
"Vishal Gupta" <vi**********@acs-inc.com> wrote in message
news:eo*************@TK2MSFTNGP03.phx.gbl...
Hi all,

I have a placeholder control on an ASPX page. I
dynamically add a few button control and label control to the placeholder
from
code - all is well with the world. But on post back the
control disappears from the placeholder. Am I missing
something here
Please help

Vishal Gupta


Jun 1 '06 #3

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

Similar topics

0
by: dwhitford | last post by:
I'm using a placeholder control to dynamically add textboxes to the web page. When the page loads I dynamically create a set of textboxes give them an id and a value. When the page postback I...
1
by: Fraggle | last post by:
I have a placeholder in a repeater, along with a textbox. For each "repeat unit" I call the onitemdatabound method and decide what I am going to put in the placholder, checkboxlist or...
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...
1
by: Ralph Krausse | last post by:
I have a sample at http://68.162.218.198/PlaceHolderTest/WebForm1.aspx. I am trying to figure out how capture a button event when I dynamically place a web user control in a placeholder control. I...
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");...
1
by: Simon Wallis | last post by:
Hi, I have a PlaceHolder on a place, to which I add a DropDownList (using myPlaceHolder.Controls.Add(ddl). The user selects something from the DropDownList and posts the page. Now I try to get...
1
by: Amir Ghezelbash | last post by:
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...
3
by: Oren | last post by:
hi, How can I retrieve the Control (wucState.ascx) from the Placeholder at the even: btn_Click: //declaration at page protected wucState WucState1; -- my control .... private void...
0
by: F | last post by:
Hi, The funniest part of the problem described here is that I am not new to ASP.NET, but honestly here I have no idea about what's going on. I have a GridView with a data source that just...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
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: 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: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
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
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...

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.