|
.net
newsgroups
|
|||||||||||||||||||||||
|
|||||||||||||||||||||||
Dynamically position custom control .ascxHi 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. 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. ok thanks for the information.
-- Show quoteHide quotePaul 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. > > > 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 -- Show quoteHide quotePaul 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. > > > 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. >> >> >> 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") -- Show quoteHide quotePaul G Software engineer. "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. > >> > >> > >> > > >
Other interesting topics
Authentication mode in web.config causing crash.
Do i loose the power of asp.net if i use a custom extension (not .aspx) with IHttpHandlerFactory what is Request.ServerVariables how to make VS auto suggest properties during dev Message Box in ASP Dataview returns 0 rows Newbie on Session State Unable to map the debug start page URL to a machine name User Controls in 2.0 embeding wmp w/instant play?l |
|||||||||||||||||||||||