473,387 Members | 1,669 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,387 software developers and data experts.

Dynamically position custom control .ascx

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.
Nov 19 '05 #1
5 1953
You can use style to change the postion.

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

Ibrahim ULUDAG
www.ibrahimuludag.com


"Paul" <Pa**@discussions.microsoft.com> wrote in message
news:16**********************************@microsof t.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.

Nov 19 '05 #2
ok thanks for the information.
--
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" <Pa**@discussions.microsoft.com> wrote in message
news:16**********************************@microsof t.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.


Nov 19 '05 #3
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" <Pa**@discussions.microsoft.com> wrote in message
news:16**********************************@microsof t.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.


Nov 19 '05 #4
Or try

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

I hope i works.

Ibrahim ULUDAG
www.ibrahimuludag.com

"Paul" <Pa**@discussions.microsoft.com> wrote in message
news:EF**********************************@microsof t.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" <Pa**@discussions.microsoft.com> wrote in message
news:16**********************************@microsof t.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.


Nov 19 '05 #5
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.
"Ibrahim ULUDAG" wrote:
Or try

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

I hope i works.

Ibrahim ULUDAG
www.ibrahimuludag.com

"Paul" <Pa**@discussions.microsoft.com> wrote in message
news:EF**********************************@microsof t.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" <Pa**@discussions.microsoft.com> wrote in message
news:16**********************************@microsof t.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.


Nov 19 '05 #6

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

1
by: Jeff Smith | last post by:
Can I load custom web user controls dynamically and access the properties and methods without having to explicitly define custom control types (example 2 below). I have custom web control named...
3
by: David Freeman | last post by:
Hi There! I'm having trouble dynamically adding custom controls. My custom controls does not use code-behind but only <script /> block for programming. So as a result, I don't need to compile my...
6
by: Steve Booth | last post by:
I have a web form with a button and a placeholder, the button adds a user control to the placeholder (and removes any existing controls). The user control contains a single button. I have done all...
6
by: | last post by:
I have made some user controls with custom properties. I can set those properties on instances of my user controls, and I have programmed my user control to do useful visual things in response to...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.