Home All Groups Group Topic Archive Search About

Dynamically position custom control .ascx

Author
10 Jun 2005 4:31 PM
Paul
Hi I have a custom control and am using as a menu on webpages, just wondering
if there is a way to position it differently on different pages, perhaps some
code in the page load event?
thanks,
--
Paul G
Software engineer.

Author
10 Jun 2005 7:19 PM
Ibrahim ULUDAG
You can use style to change the postion.

MyControl.styles.Add("position","absolute")
MyControl.styles.Add("top","20")

Ibrahim ULUDAG
www.ibrahimuludag.com




Show quoteHide quote
"Paul" <P***@discussions.microsoft.com> wrote in message
news:16C3C7FF-8FBB-45FD-958D-C8ABED5D6093@microsoft.com...
> Hi I have a custom control and am using as a menu on webpages, just
> wondering
> if there is a way to position it differently on different pages, perhaps
> some
> code in the page load event?
> thanks,
> --
> Paul G
> Software engineer.
Are all your drivers up to date? click for free checkup

Author
10 Jun 2005 7:27 PM
Paul
ok thanks for the information.
--
Paul G
Software engineer.


Show quoteHide quote
"Ibrahim ULUDAG" wrote:

> You can use style to change the postion.
>
> MyControl.styles.Add("position","absolute")
> MyControl.styles.Add("top","20")
>
> Ibrahim ULUDAG
> www.ibrahimuludag.com
>
>
>
>
> "Paul" <P***@discussions.microsoft.com> wrote in message
> news:16C3C7FF-8FBB-45FD-958D-C8ABED5D6093@microsoft.com...
> > Hi I have a custom control and am using as a menu on webpages, just
> > wondering
> > if there is a way to position it differently on different pages, perhaps
> > some
> > code in the page load event?
> > thanks,
> > --
> > Paul G
> > Software engineer.
>
>
>
Author
10 Jun 2005 7:54 PM
Paul
Hi I am having trouble accessing the styles attribute of the control, tried
the following but it does not work.  navbar.ascx is the custom control
Dim myControl As navbar = CType(Page.LoadControl("navbar.ascx"), navbar)
myControl.styles---not recognized
--
Paul G
Software engineer.


Show quoteHide quote
"Ibrahim ULUDAG" wrote:

> You can use style to change the postion.
>
> MyControl.styles.Add("position","absolute")
> MyControl.styles.Add("top","20")
>
> Ibrahim ULUDAG
> www.ibrahimuludag.com
>
>
>
>
> "Paul" <P***@discussions.microsoft.com> wrote in message
> news:16C3C7FF-8FBB-45FD-958D-C8ABED5D6093@microsoft.com...
> > Hi I have a custom control and am using as a menu on webpages, just
> > wondering
> > if there is a way to position it differently on different pages, perhaps
> > some
> > code in the page load event?
> > thanks,
> > --
> > Paul G
> > Software engineer.
>
>
>
Author
11 Jun 2005 6:35 AM
Ibrahim ULUDAG
Or try

MyControl.Attributes.Add("style","position:absolute;top:20px");

I hope i works.

Ibrahim ULUDAG
www.ibrahimuludag.com

Show quoteHide quote
"Paul" <P***@discussions.microsoft.com> wrote in message
news:EF932436-1617-429B-8115-9E00EAA03E8E@microsoft.com...
> Hi I am having trouble accessing the styles attribute of the control,
> tried
> the following but it does not work.  navbar.ascx is the custom control
> Dim myControl As navbar = CType(Page.LoadControl("navbar.ascx"), navbar)
> myControl.styles---not recognized
> --
> Paul G
> Software engineer.
>
>
> "Ibrahim ULUDAG" wrote:
>
>> You can use style to change the postion.
>>
>> MyControl.styles.Add("position","absolute")
>> MyControl.styles.Add("top","20")
>>
>> Ibrahim ULUDAG
>> www.ibrahimuludag.com
>>
>>
>>
>>
>> "Paul" <P***@discussions.microsoft.com> wrote in message
>> news:16C3C7FF-8FBB-45FD-958D-C8ABED5D6093@microsoft.com...
>> > Hi I have a custom control and am using as a menu on webpages, just
>> > wondering
>> > if there is a way to position it differently on different pages,
>> > perhaps
>> > some
>> > code in the page load event?
>> > thanks,
>> > --
>> > Paul G
>> > Software engineer.
>>
>>
>>
Author
13 Jun 2005 5:22 PM
Paul
Hi it builds and runs ok but does not seem to move the control around.
Here is what I have.
Dim myControl As navbar = CType(Page.LoadControl("navbar.ascx"), navbar)
            myControl.Attributes.Add("style", "position:absolute;left:40px")
--
Paul G
Software engineer.


Show quoteHide quote
"Ibrahim ULUDAG" wrote:

> Or try
>
> MyControl.Attributes.Add("style","position:absolute;top:20px");
>
> I hope i works.
>
> Ibrahim ULUDAG
> www.ibrahimuludag.com
>
> "Paul" <P***@discussions.microsoft.com> wrote in message
> news:EF932436-1617-429B-8115-9E00EAA03E8E@microsoft.com...
> > Hi I am having trouble accessing the styles attribute of the control,
> > tried
> > the following but it does not work.  navbar.ascx is the custom control
> > Dim myControl As navbar = CType(Page.LoadControl("navbar.ascx"), navbar)
> > myControl.styles---not recognized
> > --
> > Paul G
> > Software engineer.
> >
> >
> > "Ibrahim ULUDAG" wrote:
> >
> >> You can use style to change the postion.
> >>
> >> MyControl.styles.Add("position","absolute")
> >> MyControl.styles.Add("top","20")
> >>
> >> Ibrahim ULUDAG
> >> www.ibrahimuludag.com
> >>
> >>
> >>
> >>
> >> "Paul" <P***@discussions.microsoft.com> wrote in message
> >> news:16C3C7FF-8FBB-45FD-958D-C8ABED5D6093@microsoft.com...
> >> > Hi I have a custom control and am using as a menu on webpages, just
> >> > wondering
> >> > if there is a way to position it differently on different pages,
> >> > perhaps
> >> > some
> >> > code in the page load event?
> >> > thanks,
> >> > --
> >> > Paul G
> >> > Software engineer.
> >>
> >>
> >>
>
>
>

Bookmark and Share