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

Re-loading a UserControl after PostBack

jon
I'm trying to establish how to replace a usercontrol that has already
been loaded (using LoadControl in the Page.Load event) with a
different UserControl following a PostBack. Tying to call
LoadControl(<newControlName>) after the Page.Load routine has finished
does not appear to work. The only way I can think of doing this is to
call Server.Transfer or Request.Redirect to start a new instance of
the form but this means I loose ViewState for the existing form which
I want to retain.

I need a means of re-firing the Page.Load routine after it has occured
without user ineraction.

Any thoughts greatly appreciated.
jon
Nov 19 '05 #1
2 1947
KMA
Could you load the corresponding user control based upon the value of
Page.IsPostback in the Page.Load?

"jon" <jo*@consultix.co.uk> wrote in message
news:17**************************@posting.google.c om...
I'm trying to establish how to replace a usercontrol that has already
been loaded (using LoadControl in the Page.Load event) with a
different UserControl following a PostBack. Tying to call
LoadControl(<newControlName>) after the Page.Load routine has finished
does not appear to work. The only way I can think of doing this is to
call Server.Transfer or Request.Redirect to start a new instance of
the form but this means I loose ViewState for the existing form which
I want to retain.

I need a means of re-firing the Page.Load routine after it has occured
without user ineraction.

Any thoughts greatly appreciated.
jon

Nov 19 '05 #2
The Page_Load event is reaided upon every request. This should be an ok location
to recreate any server side controls that were dynamically added from previous
requests. I posted a sample a while ago:

http://groups-beta.google.com/group/...717a97bd32c450

It doesn't use User Controls, but it should work fine.

-Brock
DevelopMentor
http://staff.develop.com/ballen
I'm trying to establish how to replace a usercontrol that has already
been loaded (using LoadControl in the Page.Load event) with a
different UserControl following a PostBack. Tying to call
LoadControl(<newControlName>) after the Page.Load routine has finished
does not appear to work. The only way I can think of doing this is to
call Server.Transfer or Request.Redirect to start a new instance of
the form but this means I loose ViewState for the existing form which
I want to retain.

I need a means of re-firing the Page.Load routine after it has occured
without user ineraction.

Any thoughts greatly appreciated.

jon


Nov 19 '05 #3

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

Similar topics

1
by: Nel | last post by:
I have a question related to the "security" issues posed by Globals ON. It is good programming technique IMO to initialise variables, even if it's just $foo = 0; $bar = ""; Surely it would...
4
by: Craig Bailey | last post by:
Anyone recommend a good script editor for Mac OS X? Just finished a 4-day PHP class in front of a Windows machine, and liked the editor we used. Don't recall the name, but it gave line numbers as...
1
by: Chris | last post by:
Sorry to post so much code all at once but I'm banging my head against the wall trying to get this to work! Does anyone have any idea where I'm going wrong? Thanks in advance and sorry again...
11
by: James | last post by:
My form and results are on one page. If I use : if ($Company) { $query = "Select Company, Contact From tblworking Where ID = $Company Order By Company ASC"; }
4
by: Alan Walkington | last post by:
Folks: How can I get an /exec'ed/ process to run in the background on an XP box? I have a monitor-like process which I am starting as 'exec("something.exe");' and, of course the exec function...
1
by: John Ryan | last post by:
What PHP code would I use to check if submitted sites to my directory actually exist?? I want to use something that can return the server code to me, ie HTTP 300 OK, or whatever. Can I do this with...
10
by: James | last post by:
What is the best method for creating a Web Page that uses both PHP and HTML ? <HTML> BLA BLA BLA BLA BLA
8
by: Beowulf | last post by:
Hi Guru's, I have a query regarding using PHP to maintain a user profiles list. I want to be able to have a form where users can fill in their profile info (Name, hobbies etc) and attach an...
1
by: joost | last post by:
Hello, I'm kind of new to mySQL but more used to Sybase/PHP What is illegal about this query or can i not use combined query's in mySQL? DELETE FROM manufacturers WHERE manufacturers_id ...
3
by: presspley | last post by:
I have bought the book on advanced dreamweaver and PHP recently. I have installed MySQL and PHP server but am getting an error on the $GET statement show below. It says there is a problem with...
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...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 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 former...
0
by: ryjfgjl | last post by:
In our work, we often need to import Excel data into databases (such as MySQL, SQL Server, Oracle) for data analysis and processing. Usually, we use database tools like Navicat or the Excel import...
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: 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...

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.