Ask a Question related to ASP.NET General, Design and Development.
-
Gary Monk #1
Passing 'this' to a function
I would like to create a class that changes some basic
attributes of a web page based on values in a database.
Things like background color, font, text color, etc. My
problem is that I'm not sure how to pass the
variable 'this' to a class function. I need to be able
modify the properties of the controls on the web page.
Has anyone done something like this?
Thanks for the help!
Gary
Gary Monk Guest
-
Passing a ROWTYPE to a function
I'm trying to write a function that takes a %ROWTYPE as an argument. I'm just not sure how to call it from another function. This is what I tried:... -
Passing db values to function
Hello, I am creating dynamic images with corresponding checkboxes by pulling data from an Access database. The onchange event of the checkboxes... -
passing a function as a ref?
can you pass a reference to a function, then call it? How do I do it? The following does not work: function aaa(myFunc){ eval(myFunc); }... -
Passing a variable to a package function vs. a local function
I'm a bit new to this so please bear with me... I've written a script that uses CGI.pm something like this: use CGI::Carp qw(fatalsToBrowser);... -
Passing a hash to a function
I can't seem to find in in my perl book. I'd like to pass hashes to functions #!/usr/bin/perl -wT my %someHash; $someHash{'one'} = "1";... -
Kevin Spencer #2
Re: Passing 'this' to a function
I believe your problem lies in the fact that your function defines the
parameter type as a reference to the Base Page class, rather than a
reference to your inherited Page class. The types don't match exactly.
--
HTH,
Kevin Spencer
Microsoft MVP
..Net Developer
[url]http://www.takempis.com[/url]
Big things are made up of
lots of little things.
"Gary Monk" <g_monk@hotmail.com> wrote in message
news:024601c35156$f8772120$a401280a@phx.gbl...> Kevin,
>
> Thanks for the reply.
>
> I'm receiving the following error...
>
> C:\inetpub\wwwroot\MYOWorks\schedule.aspx.cs(114): The
> best overloaded method match
> for 'MYOWorks.MYOPage.SetPageDefaults(ref
> System.Web.UI.Page)' has some invalid arguments
>
> I didn't mention in my first post I'm using C#. I'm not
> sure if this makes a difference in the coding example.
>
> Here is the code I'm using...
>
> In the class...
>
> public void SetPageDefaults(ref System.Web.UI.Page
> objPage)
> {
> .
> .
> .
>
> In the program...
>
> pageSetup.SetPageDefaults( ref this );
>
> Thanks,
> Gary
>> objPage)> >-----Original Message-----
> >In your class:
> >
> >private function doWithThis(ref System.Web.UI.Page> >{
> >// do something with the Page
> >}
> >
> >In your page:
> >
> >ClassName.doWithThis(ref this);
> >
> >--
> >HTH,
> >
> >Kevin Spencer
> >Microsoft MVP
> >..Net Developer
> >[url]http://www.takempis.com[/url]
> >Big things are made up of
> >lots of little things.
> >
> >"Gary Monk" <g_monk@hotmail.com> wrote in message
> >news:02f201c35146$c2dfbff0$a001280a@phx.gbl...> >> >> I would like to create a class that changes some basic
> >> attributes of a web page based on values in a database.
> >> Things like background color, font, text color, etc. My
> >> problem is that I'm not sure how to pass the
> >> variable 'this' to a class function. I need to be able
> >> modify the properties of the controls on the web page.
> >>
> >> Has anyone done something like this?
> >>
> >> Thanks for the help!
> >> Gary
> >
> >.
> >
Kevin Spencer Guest
-
Kevin Spencer #3
Re: Passing 'this' to a function
Oops. I said "her." Sorry, Gary!
--
HTH,
Kevin Spencer
Microsoft MVP
..Net Developer
[url]http://www.takempis.com[/url]
Big things are made up of
lots of little things.
"Kevin Spencer" <kevin@takempis.com> wrote in message
news:Obl0$rVUDHA.2180@TK2MSFTNGP12.phx.gbl...In> Well, yes and no. It is a reference, and you can pass it to a function and
> make changes to the data contained therein, but not the reference itself.> her case, it really wouldn't make any difference, since she only wants to
> make changes to the properties of the page.
>
> --
> HTH,
>
> Kevin Spencer
> Microsoft MVP
> .Net Developer
> [url]http://www.takempis.com[/url]
> Big things are made up of
> lots of little things.
>
> "szabelin" <szabelin@szabelin> wrote in message
> news:03e201c35156$1fd5d2d0$a301280a@phx.gbl...>> >
> > Kevin, I was just curios why pass objPage by ref? Isn't
> > objPage already a reference?
> >
> > Thanks
> >
> >> > objPage)> > >-----Original Message-----
> > >In your class:
> > >
> > >private function doWithThis(ref System.Web.UI.Page> > >{
> > >// do something with the Page
> > >}
> > >
> > >In your page:
> > >
> > >ClassName.doWithThis(ref this);
> > >
> > >--
> > >HTH,
> > >
> > >Kevin Spencer
> > >Microsoft MVP
> > >..Net Developer
> > >[url]http://www.takempis.com[/url]
> > >Big things are made up of
> > >lots of little things.
> > >
> > >"Gary Monk" <g_monk@hotmail.com> wrote in message
> > >news:02f201c35146$c2dfbff0$a001280a@phx.gbl...
> > >> I would like to create a class that changes some basic
> > >> attributes of a web page based on values in a database.
> > >> Things like background color, font, text color, etc. My
> > >> problem is that I'm not sure how to pass the
> > >> variable 'this' to a class function. I need to be able
> > >> modify the properties of the controls on the web page.
> > >>
> > >> Has anyone done something like this?
> > >>
> > >> Thanks for the help!
> > >> Gary
> > >
> > >
> > >.
> > >
>
Kevin Spencer Guest
-
Gary Monk #4
Re: Passing 'this' to a function
No problem. Thanks for the help!!!
Gary
it to a function and>-----Original Message-----
>Oops. I said "her." Sorry, Gary!
>
>--
>HTH,
>
>Kevin Spencer
>Microsoft MVP
>..Net Developer
>[url]http://www.takempis.com[/url]
>Big things are made up of
>lots of little things.
>
>"Kevin Spencer" <kevin@takempis.com> wrote in message
>news:Obl0$rVUDHA.2180@TK2MSFTNGP12.phx.gbl...>> Well, yes and no. It is a reference, and you can passthe reference itself.>> make changes to the data contained therein, but notsince she only wants to>In>> her case, it really wouldn't make any difference,Isn't>> make changes to the properties of the page.
>>
>> --
>> HTH,
>>
>> Kevin Spencer
>> Microsoft MVP
>> .Net Developer
>> [url]http://www.takempis.com[/url]
>> Big things are made up of
>> lots of little things.
>>
>> "szabelin" <szabelin@szabelin> wrote in message
>> news:03e201c35156$1fd5d2d0$a301280a@phx.gbl...>> >
>> > Kevin, I was just curios why pass objPage by ref?basic>> > objPage already a reference?
>> >
>> > Thanks
>> >
>> >
>> > >-----Original Message-----
>> > >In your class:
>> > >
>> > >private function doWithThis(ref System.Web.UI.Page
>> > objPage)
>> > >{
>> > >// do something with the Page
>> > >}
>> > >
>> > >In your page:
>> > >
>> > >ClassName.doWithThis(ref this);
>> > >
>> > >--
>> > >HTH,
>> > >
>> > >Kevin Spencer
>> > >Microsoft MVP
>> > >..Net Developer
>> > >[url]http://www.takempis.com[/url]
>> > >Big things are made up of
>> > >lots of little things.
>> > >
>> > >"Gary Monk" <g_monk@hotmail.com> wrote in message
>> > >news:02f201c35146$c2dfbff0$a001280a@phx.gbl...
>> > >> I would like to create a class that changes somedatabase.>> > >> attributes of a web page based on values in aetc. My>> > >> Things like background color, font, text color,able>> > >> problem is that I'm not sure how to pass the
>> > >> variable 'this' to a class function. I need to bepage.>> > >> modify the properties of the controls on the web>>>>> > >>
>> > >> Has anyone done something like this?
>> > >>
>> > >> Thanks for the help!
>> > >> Gary
>> > >
>> > >
>> > >.
>> > >
>>
>
>.
>Gary Monk Guest



Reply With Quote

