CodeVerge.Net Beta


   Explore    Item Entry   Register  Login  
Microsoft News
Asp.Net Forums
IBM Software
Borland Forums
Adobe Forums
Novell Forums




Can Reply:  No Members Can Edit: No Online: Yes
Zone: > NEWSGROUP > Asp.Net Forum > windows_hosting.hosting_open_forum Tags:
Item Type: NewsGroup Date Entered: 2/20/2004 8:59:51 PM Date Modified: Subscribers: 0 Subscribe Alert
Rate It:
NR
XPoints: N/A Replies: 4 Views: 210 Favorited: 0 Favorite
5 Items, 1 Pages 1 |< << Go >> >|
jeffkretz
Asp.Net User
Load Postback Data on a event-created Child Control2/20/2004 8:59:51 PM

0

I'm building a custom repeater with various functionalities built in.

Part of this is a dynamically created search box in the header, based on the parameters of whatever stored procedure will be assigned to the repeater.

The search controls, which are TextBox or DropDownLists are Templated with the OnInit event, and are actually created and added as child controls during the OnDataBinding event.

When the page is posted back, I have to re-run the stored procedure with the new search keys and regenerate the repeater, and re-databind the repeater elements.

Unfortunately, this means that I don't have the new posted data in the search elements yet, as they haven't been created at this stage in the life cycle!

-----------

I figure there's probably something wrong with my general approach, which maybe is complexifying the situation.

Basically, I'd like the search elements in my custom repeater control to be dynamically generated, the contents of the repeater to be re-generated after each postback (with the new search criteria) and the post-back data of each search element to be available for the data binding.

Any ideas?

Thanks,
JK
master4eva
Asp.Net User
Re: Load Postback Data on a event-created Child Control2/21/2004 7:52:47 AM

0

Jeff,

You might want to try some code like this:

protected override OnInit(EventArgs e) {
if (TemplateHeader != null)
TemplateHeader.InstantiateIn(this);

base.OnInit(e);
}

-- Justin Lovell
jeffkretz
Asp.Net User
Re: Load Postback Data on a event-created Child Control2/23/2004 9:53:53 PM

0

Thanks,

I looked over the Help files for the InstantiateIn method, and it doesn't really cover that much about it.

What would this do differently? (Just so I understand).

Cheers,
JK
master4eva
Asp.Net User
Re: Load Postback Data on a event-created Child Control2/24/2004 1:25:20 PM

0

BTW - I have written an article on this and you may view it here:

http://aspalliance.com/366

And snipleting from the article:

<snip>

However, to explain the logic of the InstantiateIn method: this method is called by the container of the template. If the template has any controls to add to the container control, it has to be done over here and no where else. Basically, the templates in the containing controls are abstracts of controls but are not given life yet because it is not added to the page?s control tree ? it is seen as part of the control. Once the InstantiateIn method is called, it is the templates chance to put the abstract controls that it contains into the page?s control tree; hence, giving the controls inside the template, the gift of life.

</snip>
-- Justin Lovell
jeffkretz
Asp.Net User
Re: Load Postback Data on a event-created Child Control2/25/2004 11:15:42 PM

0

Thanks a million. That is a very comprehensive article, and I think I've got a handle on the issue I was having.

JK
5 Items, 1 Pages 1 |< << Go >> >|


Free Download:

Books:
Programming ASP.NET Authors: Jesse Liberty, Dan Hurwitz, Pages: 988, Published: 2003
Programming Visual Basic 2005 Authors: Jesse Liberty, Pages: 548, Published: 2005
Professional ASP.NET 2.0 Server Control and Component Development Authors: Shahram Khosravi, Pages: 1186, Published: 2006
Developing Microsoft ASP.NET Server Controls and Components Authors: Nikhil Kothari, Vandana Datye, Pages: 689, Published: 2002
Pro ASP.NET 2.0 in C# 2005 Authors: Matthew MacDonald, Mario Szpuszta, Pages: 1255, Published: 2005

Web:
ASP.NET Page Life Cycle Overview During load, if the current request is a postback, control properties are ... For more information, see Data Binding Events for Data-Bound Controls later in ... The Init event (and also the Unload event) for each child control occur ... in the page life cycle than the same events for controls created declaratively. ...
composite control and postback data change handling However because the control is created dynamically the postback data does ... Load event and also can be recalled in other events (no later than the ... child controls have performed postback processing at that stage? Or do I ...
.NET 247 The CreateChildControls method is used to create all the child controls. ... the CreateChildControls method fire on postback prior to my event getting handled? .... For composite control, the load and maintenance of postback data is ...
ASP.NET Page Life Cycle & Common Events the postback data has not yet been loaded and control property values have not ... to perform processing on your page or control before the Load event. ... each child control, which does the same for each of its child controls ... the control's markup that is sent to the browser. If you create a custom control, you ...
GridView and Load Postback Data stage - Stack Overflow I think in this case the event is raised during: "Handle postback events" ... Why do controls get populated with postback data twice - during LoadPostBack ... How do I enable ViewState for child custom controls when disabled in parent? ...

Load Postback Data on a event-created Child Control - ng.asp-net ... Load Postback Data on a event-created Child Control, > ROOT > NEWSGROUP > Asp. Net Forum > windows_hosting.hosting_open_forum, ...
Postback and UserControl. - ng.asp-net-forum.windows ... Load postback data for dynamical controls added on Page_Load ... Load Postback Data on a event-created Child Control - ng.asp-net . ...
Question OnDataBinding for Custom Control - ng.asp-net-forum ... Load Postback Data on a event-created Child Control - ng.asp-net ... ... created and added as child controls during the OnDataBinding event. ...
Building a data-bound Templated Control - ng.asp-net-forum.windows ... Load Postback Data on a event-created Child Control - ng.asp-net ... I'm building a custom repeater with various functionalities built in . ...
ParseChildren for child controls but not sub-child controls - ng ... getting the collection out of the dropdownlist · email · load web user control on page load · load postback data on a event-created child control ...






looking for providers that will help our customer install our software?

typeconvertor problem

display error by using winform control and infragistics components

hosting recommendations from this list

custom list control

getting a list of controls in the property inspector

problem creating a datagrid using template class at run-time

how to implement an custom image control

intercepting postback for a control event.

rich text box for visual basic.net

vs.net custom designer

servergrid

examples of using controlbuilder

how to auto generating your own partial classes

problem with user control event

wysiwyg editor

building dynamic buttons

addstyleattribute works on ie but not firefox: why?

server control design view

user control design time questions

did they improve the treeview control for 2.0?

date picker control wanted with formatting

sharing controls between two web sites

how to call imagebutton event from user control?

generate css

dynamic user control postback not firing

adding a <table> to custom web control

treeview specified cast is not valid error

2 listitemcollection

perl cgi, python and php4/5 on windows hosting

   
  Privacy | Contact Us
All Times Are GMT