473,659 Members | 2,663 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

postbacks for controls added at PreRender stage of a page

Hi
If I add a UserControl to a placeholder on a page during that pages PreRender
stage and press a button on that UserControl will the postback for that button
get processed?
I would have thought yes because on adding the control I would have
thought that the OnInit, IPostBackDataHa ndler, etc calls would then be
applied purely to that calendar, however it doesn't seem to be happening
I'm getting around this at the moment by adding the UserControl to
the placeholder in the OnInit stage and if it shouldn't be there I'm
removing it in the PreRender stage

Thanks for any help

F
Nov 17 '05 #1
6 1951
Are you re-adding the UserControl with the next PostBack? If so, are you
re-adding it prior to the LoadPostData Event?

--
HTH,

Kevin Spencer
Microsoft MVP
..Net Developer
http://www.takempis.com
Big Things are made up of
Lots of Little Things.

<fo******@yahoo .co.uk> wrote in message
news:ac******** *************** ***@posting.goo gle.com...
Hi
If I add a UserControl to a placeholder on a page during that pages PreRender stage and press a button on that UserControl will the postback for that button get processed?
I would have thought yes because on adding the control I would have
thought that the OnInit, IPostBackDataHa ndler, etc calls would then be
applied purely to that calendar, however it doesn't seem to be happening
I'm getting around this at the moment by adding the UserControl to
the placeholder in the OnInit stage and if it shouldn't be there I'm
removing it in the PreRender stage

Thanks for any help

F

Nov 17 '05 #2
Are you re-adding the UserControl with the next PostBack? If so, are you
re-adding it prior to the LoadPostData Event?

--
HTH,

Kevin Spencer
Microsoft MVP
..Net Developer
http://www.takempis.com
Big Things are made up of
Lots of Little Things.

<fo******@yahoo .co.uk> wrote in message
news:ac******** *************** ***@posting.goo gle.com...
Hi
If I add a UserControl to a placeholder on a page during that pages PreRender stage and press a button on that UserControl will the postback for that button get processed?
I would have thought yes because on adding the control I would have
thought that the OnInit, IPostBackDataHa ndler, etc calls would then be
applied purely to that calendar, however it doesn't seem to be happening
I'm getting around this at the moment by adding the UserControl to
the placeholder in the OnInit stage and if it shouldn't be there I'm
removing it in the PreRender stage

Thanks for any help

F

Nov 17 '05 #3
SF
Looks like your viewstate is out of sync with your page's controls, since
you dynamically added some at
runtime...http://msdn.microsoft.com/library/de...ibrary/en-us/v
bcon/html/vbtskaddingcont rolstowebformsp ageprogrammatic ally.asp

"Kevin Spencer" <ke***@DIESPAMM ERSDIEtakempis. com> wrote in message
news:#8******** ******@TK2MSFTN GP12.phx.gbl...
Are you re-adding the UserControl with the next PostBack? If so, are you
re-adding it prior to the LoadPostData Event?

--
HTH,

Kevin Spencer
Microsoft MVP
.Net Developer
http://www.takempis.com
Big Things are made up of
Lots of Little Things.

<fo******@yahoo .co.uk> wrote in message
news:ac******** *************** ***@posting.goo gle.com...
Hi
If I add a UserControl to a placeholder on a page during that pages

PreRender
stage and press a button on that UserControl will the postback for that

button
get processed?
I would have thought yes because on adding the control I would have
thought that the OnInit, IPostBackDataHa ndler, etc calls would then be
applied purely to that calendar, however it doesn't seem to be happening
I'm getting around this at the moment by adding the UserControl to
the placeholder in the OnInit stage and if it shouldn't be there I'm
removing it in the PreRender stage

Thanks for any help

F


Nov 17 '05 #4
SF
Looks like your viewstate is out of sync with your page's controls, since
you dynamically added some at
runtime...http://msdn.microsoft.com/library/de...ibrary/en-us/v
bcon/html/vbtskaddingcont rolstowebformsp ageprogrammatic ally.asp

"Kevin Spencer" <ke***@DIESPAMM ERSDIEtakempis. com> wrote in message
news:#8******** ******@TK2MSFTN GP12.phx.gbl...
Are you re-adding the UserControl with the next PostBack? If so, are you
re-adding it prior to the LoadPostData Event?

--
HTH,

Kevin Spencer
Microsoft MVP
.Net Developer
http://www.takempis.com
Big Things are made up of
Lots of Little Things.

<fo******@yahoo .co.uk> wrote in message
news:ac******** *************** ***@posting.goo gle.com...
Hi
If I add a UserControl to a placeholder on a page during that pages

PreRender
stage and press a button on that UserControl will the postback for that

button
get processed?
I would have thought yes because on adding the control I would have
thought that the OnInit, IPostBackDataHa ndler, etc calls would then be
applied purely to that calendar, however it doesn't seem to be happening
I'm getting around this at the moment by adding the UserControl to
the placeholder in the OnInit stage and if it shouldn't be there I'm
removing it in the PreRender stage

Thanks for any help

F


Nov 17 '05 #5
> Are you re-adding the UserControl with the next PostBack? If so, are you
re-adding it prior to the LoadPostData Event?


The page has a button and a placeholder. The button is toggling a flag.
If by the PreRender stage (i.e. after postbacks) the flag has been set
then the UserControl is placed in the placeholder. The flag is a static
member variable (at the moment) so once its set it stays set until the
button is pressed again and the UserControl is loaded.
Nov 17 '05 #6
> Are you re-adding the UserControl with the next PostBack? If so, are you
re-adding it prior to the LoadPostData Event?


The page has a button and a placeholder. The button is toggling a flag.
If by the PreRender stage (i.e. after postbacks) the flag has been set
then the UserControl is placed in the placeholder. The flag is a static
member variable (at the moment) so once its set it stays set until the
button is pressed again and the UserControl is loaded.
Nov 17 '05 #7

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

Similar topics

0
296
by: foldface | last post by:
Hi If I add a UserControl to a placeholder on a page during that pages PreRender stage and press a button on that UserControl will the postback for that button get processed? I would have thought yes because on adding the control I would have thought that the OnInit, IPostBackDataHandler, etc calls would then be applied purely to that calendar, however it doesn't seem to be happening I'm getting around this at the moment by adding the...
0
345
by: Kenton Smeltzer | last post by:
Hello All, I am having a problem with events and the addition of controls on a page I am developing. First let me tell you what I have tried and then maybe someone can see something I missed. First I tried adding the controls and the event handlers for my control in the Initialize Components method of my page in the hopes that it would fire the event before the
2
1804
by: luca | last post by:
I'm trying to build a Server Control, it's a calendar to manage sellers appointments (don't answer me to use and custumize Calendar Control because unluckily it's not possible for this specific project). A piece of my control's interface is composed of a table and in each of its cells are stored informations about a seller, a date and a time range. Each of these cells has to be an interactive element: I should be able to process datas...
2
4848
by: D Sheldon | last post by:
I am creating a server control that adds web controls (i.e. textboxes, etc) to a form. I use HtmlTable to build the table and insert the controls. Now I want to add validators to the textbox. Here is the code that I am using bool lastnamerequired=false public bool LastNameRequire get{return lastnamerequired; set{lastnamerequired = value; if(lastnamerequired
7
1294
by: Dominique Vandensteen | last post by:
I have a Table to which I add a LinkButton in the PreRender event The LinkButton is visible on the webpage but when I click it, the LinkButton_Click method is not called and the page just "reloads" anybody an idea what I'm missing here? Private Sub Page_PreRender(ByVal sender As Object, ByVal e As System.EventArgs) Handles MyBase.PreRender
22
2174
by: Mr Newbie | last post by:
I was thinking about developing a workflow application yesterday and was musing over the different approaches than one could take in restricting specific actions on a ticket( Form ) at any said stage. One approach I have used on other systems is to prevent the action buttons appearing. For example, if one did not have the Role of Administrator, one would be prevented from deleting a ticket not created by oneself. However, it did occur...
5
1842
by: Fred | last post by:
hi, i have a page written by someone else w/ a few user controls inside it(w/ user controls inside em too) - what i dont get is the order different page_inits, page_loads, cashed and postback events and code inside <% %> are executing can u plz point me to a specification or some other description of the whole process TIA
1
2354
by: Khafancoder | last post by:
Hi guys, i'm trying to change all of page control's (root controls and inner controls) forecolor in PreRender event. it works fine but when a postback occures by detailsview command buttons, it fails... (i trace the code, it even executes in postbacks but control's forecolor don't change)
3
4358
balabaster
by: balabaster | last post by:
I've got a user control that builds a table of dynamic data based on a :LINQ class holding the data. The data is loaded using the LoadData(DataInstance) method. The table it builds contains a number of dynamic controls that themselves have postback/autopostback so the display of the control needs to be built at latest in the Page.Load event or the event handlers for the controls don't get wired up. Now if I have a page that uses this user...
0
8330
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 effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
8850
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, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
8626
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
1
6178
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
5649
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
4334
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
2749
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
2
1975
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
2
1737
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

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.