Wrox Programmer Forums
Go Back   Wrox Programmer Forums > ASP.NET and ASP > ASP.NET 1.0 and 1.1 > ASP.NET 1.1
|
ASP.NET 1.1 As of 10/6/2005, this forum is locked as part of the reorganization described here: http://p2p.wrox.com/topic.asp?TOPIC_ID=35394. No posts have been deleted. Open ongoing discussions from the last week have been moved to either ASP.NET 1.0 and 1.1 Beginners http://p2p.wrox.com/asp-net-1-0-1-1-basics-60/ or ASP.NET 1.0 and 1.1 Professional. http://p2p.wrox.com/forum.asp?FORUM_ID=50. See my sticky post inside for more.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the ASP.NET 1.1 section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
 
Old August 31st, 2005, 03:13 PM
Authorized User
 
Join Date: Nov 2003
Posts: 24
Thanks: 0
Thanked 0 Times in 0 Posts
Default custom server control and postback

Hi everyone,

            I have a good question. I created a custom server control that i bind a collection and my control show item in the collectino with a iterator. I would like that my control put the collection in the postback and when the page will refrech my control show the same result like the first time a bind the collection. I would like that my control give the same result that a datagrid on the postback. I found many example with simple custom server control with a textbox, but in my situation it's a collection and not a string in a textbox.

 thanks in advanced

François

 
Old September 10th, 2005, 05:34 PM
planoie's Avatar
Friend of Wrox
 
Join Date: Aug 2003
Posts: 5,407
Thanks: 0
Thanked 16 Times in 16 Posts
Default

You'll need to persist the collection to the viewstate of your control. usually this is simply just a matter of asigning the value to a viewstate key:

ViewState("dataSource") = theCollection

Then you'll need to restore (rebind) the control from that datasource. You can override the LoadViewState method and bind the inner parts of your control in that method.

-Peter





Similar Threads
Thread Thread Starter Forum Replies Last Post
Custom Server Control....Custom Property Editor ZArrinPour ASP.NET 1.0 and 1.1 Basics 1 June 15th, 2010 11:30 AM
LinkButton PostBack handler in custom control Ozzy Bongo BOOK: Professional ASP.NET 2.0 Server Control and Component Development ISBN: 978-0-471-79350-2 0 July 24th, 2008 07:55 AM
Help! Custom Server Control using User Control diehard ASP.NET 1.0 and 1.1 Professional 2 January 4th, 2006 12:33 PM
User Control within Custom Server Controls www2004 ASP.NET 1.x and 2.0 Application Design 3 April 15th, 2005 09:00 AM
Assigning DataSet To Custom Server Control Raz Muhammad General .NET 0 November 29th, 2004 01:03 AM





Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.