you need to provide a link to the context
not sure how you would do this in a component but if it were a class and
you were calling a method from the page you might do something like
myclass.new(context.current)
and then in the class
you can do context.reponse.write("Hello world")
there is a pointer to a good article on this that i think includes
components on www.dotnet247.com do a search for context i think they are
buy a susan somebody or other.
Pat
-----Original Message-----
From: benjamin [mailto:benjamin@e...]
Sent: 05 April 2002 01:57
To: ASPX_Professional
Subject: [aspx_professional] Re: DataGrid Column Collection and Post
back
I am writing a component in a separate file. How would I add the
controls
in Page_OnInit ? I can't access the page itself. Or can I ?
>
> Where are you doing "DataGrid.Columns.Add(BoundColumn)"? In order to
> access control AFTER POSTBACK, you need to add server controls
> in "Page_OnInit()" event handler. If you do it in Page_OnLoad(), you
won't
> be able to access the BoundColumns you add manually.
--------------------------------------------------------
The contents of this e-mail are confidential to the ordinary user of the
e-mail address to which it was addressed, or in the case of an
incorrectly addressed e-mail message, the intended recipient. No-one
else may copy, use, disseminate or forward all or any part of it in any
form.
Although this email, including any attachments, is believed to be free
of any virus, or other defect which might affect any computer or IT
system into which it is received and opened, it is the responsibility of
the recipient to ensure that it is virus free, and no responsibility is
accepted for any loss or damage arising in any way from its use.
The views expressed in this e-mail are those of the sender and not
necessarily the employees company.
If you receive this e-mail in error please accept our apology. If this
is the case we would be obliged if you would contact the sender and then
delete the e-mail.
--------------------------------------------------------