Ask a Question related to ASP.NET Building Controls, Design and Development.
-
Nathan Sokalski #1
Copying A Control Not As A Reference
I have a Control that I want to copy as a copy of the Control, not a copy of
the reference to the original. My reason for doing this is because some of
the methods I would calling would prevent proper rendering afterwards. I
access the Control as a parameter of a function, as follows:
Private Function MyFunction(ByVal ctrl As Control) As String
'code that will make a copy of ctrl
'my function code
End Function
(NOTE: I am using VB.NET and .NET Framework 1.1) Thanks.
--
Nathan Sokalski
[email]njsokalski@hotmail.com[/email]
[url]http://www.nathansokalski.com/[/url]
Nathan Sokalski Guest
-
reference to Composite Control
Hi, I have created a composite control which, in its simplest form inherits from Control, implements INamingContainer and provides a method... -
#40737 [NEW]: Variable passing by reference instead of copying.
From: anter at voliacable dot com Operating system: XP Prof SP2 PHP version: 5.2.1 PHP Bug Type: Class/Object related Bug... -
Reference Datagrid Footer Control
In a datagrid footer, how could I programmatically set a footer textbox text? E.g.. the datagrid (dg1) will bind to a datareader based on a query.... -
Simple Control With a Reference to Another Control
Hello, I am trying to make a Web Cstom Control with a property which is simply a reference to another control. This is exactly the same as the... -
ActiveX control for copying file in DTS
Hi Freinds, I need to copy a file from: \\serverone\folder\myfile.txt to \\servertwo\folder\myfile.txt where \\servertwo is my sql server and... -
tomb #2
Re: Copying A Control Not As A Reference
Nathan Sokalski wrote:
You have to pass the ctrl ByRef in order to be working with the one you>I have a Control that I want to copy as a copy of the Control, not a copy of
>the reference to the original. My reason for doing this is because some of
>the methods I would calling would prevent proper rendering afterwards. I
>access the Control as a parameter of a function, as follows:
>
>Private Function MyFunction(ByVal ctrl As Control) As String
> 'code that will make a copy of ctrl
> 'my function code
>End Function
>
>(NOTE: I am using VB.NET and .NET Framework 1.1) Thanks.
>
>
want to copy.
T
tomb Guest
-
Nathan Sokalski #3
Re: Copying A Control Not As A Reference
That does not help. Let me try explaining my problem differently with an
example:
Private Function MyFunction(ByVal ctrl As Control) As String
dim copyofctrl as Control
'copyofctrl=ctrl this will be replaced with code that will assign a
copy of ctrl to copyofctrl that points to a new instance of whatever type
ctrl was
'my function code
End Function
In the part of my code labeled "my function code" I want to be able to do
ANYTHING I WANT to the local variable copyofctrl without having any effect
on ctrl. Hopefully this clears up what I am trying to do.
--
Nathan Sokalski
[email]njsokalski@hotmail.com[/email]
[url]http://www.nathansokalski.com/[/url]
"tomb" <tomb@technetcenter.com> wrote in message
news:RV5jg.71053$QU3.68250@bignews8.bellsouth.net. ..> Nathan Sokalski wrote:
>> You have to pass the ctrl ByRef in order to be working with the one you>>I have a Control that I want to copy as a copy of the Control, not a copy
>>of the reference to the original. My reason for doing this is because some
>>of the methods I would calling would prevent proper rendering afterwards.
>>I access the Control as a parameter of a function, as follows:
>>
>>Private Function MyFunction(ByVal ctrl As Control) As String
>> 'code that will make a copy of ctrl
>> 'my function code
>>End Function
>>
>>(NOTE: I am using VB.NET and .NET Framework 1.1) Thanks.
>>
> want to copy.
>
> T
Nathan Sokalski Guest
-
Cor Ligthert [MVP] #4
Re: Copying A Control Not As A Reference
Nathan,
If a class is serializable you can almost forever copy something to
serialize the object first and than deserialize it again.
[url]http://www.vb-tips.com/default.aspx?ID=7ffd296f-9e81-47e6-88dc-61641f5c8d9d[/url]
I hope this helps,
Cor
"Nathan Sokalski" <njsokalski@hotmail.com> schreef in bericht
news:%23ZajLSdjGHA.3440@TK2MSFTNGP02.phx.gbl...>I have a Control that I want to copy as a copy of the Control, not a copy
>of the reference to the original. My reason for doing this is because some
>of the methods I would calling would prevent proper rendering afterwards. I
>access the Control as a parameter of a function, as follows:
>
> Private Function MyFunction(ByVal ctrl As Control) As String
> 'code that will make a copy of ctrl
> 'my function code
> End Function
>
> (NOTE: I am using VB.NET and .NET Framework 1.1) Thanks.
> --
> Nathan Sokalski
> [email]njsokalski@hotmail.com[/email]
> [url]http://www.nathansokalski.com/[/url]
>
Cor Ligthert [MVP] Guest
-
Herfried K. Wagner [MVP] #5
Re: Copying A Control Not As A Reference
"tomb" <tomb@technetcenter.com> schrieb:
No, you should pass it 'ByVal' because 'Control' is already a reference>>>I have a Control that I want to copy as a copy of the Control, not a copy
>>of the reference to the original. My reason for doing this is because some
>>of the methods I would calling would prevent proper rendering afterwards.
>>I access the Control as a parameter of a function, as follows:
>>
>>Private Function MyFunction(ByVal ctrl As Control) As String
>> 'code that will make a copy of ctrl
>> 'my function code
>>End Function
>>
>>(NOTE: I am using VB.NET and .NET Framework 1.1) Thanks.
> You have to pass the ctrl ByRef in order to be working with the one you
> want to copy.
type.
--
M S Herfried K. Wagner
M V P <URL:http://dotnet.mvps.org/>
V B <URL:http://classicvb.org/petition/>
Herfried K. Wagner [MVP] Guest



Reply With Quote

