Hi Rainer,
[quoted text, click to view] >>>> is there a way, that the custom control hast direct access
>>>> to the request object of a page where it is used?
Yes, you can use System.Web.HttpContext.Current.Request
[quoted text, click to view] >>>> when i add a custom control via the command "controls.add(oControl)" to
>>>> a web page it disappears after a postback. what must i do to make it
>>>> "constant"?
You need to add the control everytime, no matter the value of IsPostBack or
anything else. If you only add the control when a specific condition is met
(ie. IsPostBack == false or a click button, etc) then next time the page is
posted back your control won't be there. This is because ASP.NET doesn't
"automagically remember" previously created dynamic controls.
--
Victor Garcia Aprea
Microsoft MVP | ASP.NET
Looking for insights on ASP.NET? Read my blog:
http://obies.com/vga/blog.aspx To contact me remove 'NOSPAM'. Please post all questions to the newsgroup
[quoted text, click to view] "Rainer Hahnekamp" <rainer.hahnekamp@aon.at> wrote in message
news:e51Q19r5DHA.2560@TK2MSFTNGP09.phx.gbl...
> Hi,
>
> i tried to create my own custom controls and met following problems:
> -according to the book "Programming ASP.NET" i created two projects
> within my solution. one is the main and the other holds the custom
> controls. as output path i set the binary directory of the inetpub path.
> all works fine except that the custom controls also needs access to the
> classes within the main project. after compiling i get the error
> message, that the binary file could not have been copied, because it was
> in use by another process. what should i do in this case?
> -is there a way, that the custom control hast direct access to the
> request object of a page where it is used?
> -when i add a custom control via the command "controls.add(oControl)" to
> a web page it disappears after a postback. what must i do to make it
> "constant"?
>
> greetings,
> -rainer hahnekamp