Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > ASP .Net > ASP .Net Web Controls > Beginner Question Asp.Net

Reply
Thread Tools

Beginner Question Asp.Net

 
 
Roger Stenson
Guest
Posts: n/a
 
      04-09-2008
Hi all
I would be grateful for some advice on setting the "body" properties of a
MasterForm programatically in "VB"
Roger Stenson

 
Reply With Quote
 
 
 
 
Roger Stenson
Guest
Posts: n/a
 
      04-09-2008
Thanks for your help. Really appreciate it.
I had arrived at the method but the appropriate syntax -
"Attributes.Add("style," etc did not emerge from my fidling with the
autosuggestions by the compiler. Your proposal worked a treat enabling me to
complete the set up of the user options relating to page format
Roger Stenson

"David R. Longnecker" <(E-Mail Removed)> wrote in message
news:(E-Mail Removed) .com...
> Roger-
>
> You can by control the body properties by turning it into a
> HtmlGenericControl.
>
> 1. Add the runat="server" and an id attribute to your body tag.
> <body runat="server" id="MasterBodyTag">
>
> 2. In your code behind, you can address the body tag with whatever Id you
> assign to it.
> Protected Sub Page_Load(ByVal sender As Object, ByVal e As
> System.EventArgs) Handles Me.Load
> MasterBodyTag.Attributes.Add("style", "color:#ff9900")
> MasterBodyTag.Controls.Add(New LiteralControl("<p>Hello,
> world!</p>"))
> End Sub
>
> 3. View your page, if you look at the source code, you should see:
>
> <body id="ctl00_MasterBodyTag" style="bgcolor:#ff9900">
>
> and
>
> <p>Hello, world!</p>
>
> inside the body tag.
>
> Hope this helps!
>
> -dl
>
> --
> David R. Longnecker
> http://blog.tiredstudent.com
>
>> Hi all
>> I would be grateful for some advice on setting the "body" properties
>> of a
>> MasterForm programatically in "VB"
>> Roger Stenson

>
>


 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Beginner's Beginner william nelson Ruby 7 04-11-2011 11:23 PM
beginner's question.. Scott Needham Wireless Networking 4 09-06-2005 12:52 AM
No Class at ALL!!! beginner/beginner question =?Utf-8?B?S3VydCBTY2hyb2VkZXI=?= ASP .Net 7 02-03-2005 02:47 PM
Tutorial for beginner/ Tutorial voor beginner Rensjuh C++ 7 09-02-2004 12:41 AM
Beginner question: What trigs processes Jerker Hammarberg VHDL 16 07-22-2003 03:58 PM



Advertisments