CodeVerge.Net Beta


   Explore    Item Entry   Register  Login  
Microsoft News
Asp.Net Forums
IBM Software
Borland Forums
Adobe Forums
Novell Forums

ASP.NET Web Hosting – 3 Months Free!



Zone: > NEWSGROUP > Asp.Net Forum > general_asp.net.master_pages_themes_and_navigation_controls Tags:
Item Type: NewsGroup Date Entered: 5/29/2007 11:43:58 PM Date Modified: Subscribers: 0 Subscribe Alert
Rate It:
(NR, 0)
XPoints: N/A Replies: 6 Views: 55 Favorited: 0 Favorite
Can Reply:  No Members Can Edit: No Online: Yes
7 Items, 1 Pages 1 |< << Go >> >|
TallMike
Asp.Net User
How do I use the style property of a HTMLGeneric control5/29/2007 11:43:58 PM

0/0

I add a runat server tag to a div tag.  I can control it's visibility, ect with code like "MyDivArea.Visible = false;

But I'm not sure how to set the width of MyDivArea using the style property.  This doesn't work.

MyDivArea.style.value ="width:100%;"

 I just want to temporarily change the width, but then have it go back to it's original size also.

Thanks,

Mike

agolden
Asp.Net User
Re: How do I use the style property of a HTMLGeneric control5/30/2007 1:56:20 AM

0/0

 Hi Mike, 

You can use either of the two options below:

MyDivArea.Style(HtmlTextWriterStyle.Width) = "100%"
MyDivArea.Style("height") = "100%"

Hope that helps.

Aaron

Weoncito
Asp.Net User
Re: How do I use the style property of a HTMLGeneric control5/30/2007 2:02:07 AM

0/0

If you're doing this in JavaScript it's like

MyDivArea = document.getElementById("someID"); 

MyDivArea.style.width="100%";

If you're doing this in the code behind it would look like

MyDivArea.Style.Add("width","100%");

TallMike
Asp.Net User
Re: How do I use the style property of a HTMLGeneric control5/30/2007 2:39:12 AM

0/0

niether worked I must being doing something wrong. I got the error "style is a property but used like a method.  I codeing in C#.  Not sure if that helps.

Thanks anyway

Mike 

 

agolden
Asp.Net User
Re: How do I use the style property of a HTMLGeneric control5/30/2007 2:47:09 AM

0/0

Ah, I thought you were using VB, try

MyDivArea.Style[HtmlTextWriterStyle.Width] = "100%";
MyDivArea.Style["width"] = "100%";
Amanda Wang - M
Asp.Net User
Re: How do I use the style property of a HTMLGeneric control5/31/2007 4:54:37 AM

1/1

Hi Mike,

If you want to  control div's visibility , you should set the border of the div, because the border value is no set or none by default, so you could not see the div control without changing the border style.,

Hope it helps.


Please remember to mark the replies as answers if they help and unmark them if they provide no help.


Yours sincerely,
Amanda Wang
Microsoft Online Community Support
TallMike
Asp.Net User
Re: How do I use the style property of a HTMLGeneric control5/31/2007 5:01:18 PM

0/0

I gave up and built a table.  I could set the div's visibilty to false fine and it looked good, but when I tried to make it visible it, allot of the nested controls remained visible = false.  They remained this way even after I stopped debugging and un do my changes.  I couldn't get it back and had to resort to a backup copy of my web.

I am using starter kit and when IE window is too small, one div falls below another.  I just wanted it to remain in place and activate a scroll bar to scroll to the left.

I got rid of Divs and am almost finished recreating GUI with a table.

Thanks for your comment

Mike

7 Items, 1 Pages 1 |< << Go >> >|


Free Download:

Books:
Build Your Own ASP.NET 2.0 Web Site Using C# & VB: The Ultimate ASP.NET Begginner's Guide Authors: Cristian Darie, Zak Ruvalcaba, Pages: 689, Published: 2006
Build Your Own ASP.NET Website Using C# & VB.NET Authors: Zak Ruvalcaba, Pages: 746, Published: 2004
Professional ASP.NET 1.0: Updated and Tested for Final Release of ASP.NET V.1.0 Authors: Richard Anderson, Alex Homer, Dave Sussman, Karli Watson, Pages: 1354, Published: 2002
Windows 2000 Registry Authors: Paul J. Sanna, Pages: 463, Published: 1999

Web:
How do I use the style property of a HTMLGeneric control - ASP.NET ... How do I use the style property of a HTMLGeneric control. Last post 05-31-2007 1 :01 PM by TallMike. 6 replies. Sort Posts: ...
ASP.NET HtmlGeneric Control The HtmlGeneric control is used to control other HTML element not specified by ... Style, Sets or returns the CSS properties that are applied to the control ...
O'Reilly - Safari Books Online - 0957921861 - Build Your Own ASP ... The HtmlGeneric control corresponds to HTML elements that do not have their own specific HTML ... Style. Contains the control's CSS properties. TagName ...
how to program the
element? - .NET ASP to create a DIV (html) element I use the HTMLGeneric control;
Server Controls and Validation Professional ASP.NET chapter 5 Setting Style Properties. Managing ViewState Across Postbacks. Examples on:. The HtmlGeneric Control. The HtmlAnchor Control. The HtmlImage Control ...
HtmlGenericControl Server Control Declarative Syntax You can also use the Page_Load event to generate text in a span control and HTML style attributes to format the text when it is displayed in the browser. ...
VB.NET Creating and Managing Components Part 2 The following demo illustrates the use of HTMLGeneric Control to access the HTML ... few properties that are essential to the application being developed. ...
How to dynamically write html based on a var from code behind? If you only want to switch the style sheet, then add "runat=server" property to the link control... now you'll have access to it in the code ...
Visual Studio ASP.NET using VB.NET OR C# and SQLServer2005 Types of Styles and Style Sheets. Style Properties. The CssClass Property ... HtmlButton Control. HtmlForm Control. HtmlGeneric Control. HtmlImage Control ...
How to reference a
or in FormView - ASP.NET Forums Div is a HtmlGeneric control type. You cast the control to HtmlGeneric type. Now you can use its InnerHTML property to set the text. ...




Search This Site:










reload contenplaceholder in my masterpage

asp.net menu not working in 2003 server.

applying different header properties

onselectednodechanged handling client side (treeview 2.0)

masterpage, contentpage and input textbox?

disable automatic inclusion of stylesheets

master pages - cannot place content placeholder side by side

no link displayed on sitemappath

how to design a theme

how to implement a particular type of menu

css hyperlinks overpowering my menu control

fill tree view nodes programmatically

changing web site colors using themes - doubt

how to move web.sitemap

how to refresh content page only

updatepanel and masterpage

invalid theme or stylesheet theme value.

gridview and button control help please!!!!

problem with master page

how to include a url in web.sitemap?

how to apply skin and css without using themes

image not displaying correctly with css

change iframe content when clicking on an <asp:menu> item

treeview errors

target new window and .cmd file questions

treeview + style

can a javascript source file be imported into a contentpage?

menu item onclick width

configuring multiple site maps in the web.config file

changing an image file in a theme

  Privacy | Contact Us
All Times Are GMT