Wrox Programmer Forums

Need to download code?

View our list of code downloads.

Go Back   Wrox Programmer Forums > .NET > .NET 2.0 and Visual Studio. 2005 > .NET Framework 2.0
Password Reminder
| FAQ | Members List | Calendar | Search | Today's Posts | Mark Forums Read
.NET Framework 2.0 For discussion of the Microsoft .NET Framework 2.0.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the .NET Framework 2.0 section of the Wrox Programmer to Programmer discussions. This is a community of tens of thousands of software programmers and website developers including Wrox book authors and readers. As a guest, you can read any forum posting. By joining today you can post your own programming questions, respond to other developers’ questions, and eliminate the ads that are displayed to guests. Registration is fast, simple and absolutely free .
DRM-free e-books 300x50
Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old September 13th, 2006, 11:05 AM
Registered User
Join Date: May 2006
Location: , , Austria.
Posts: 7
Thanks: 0
Thanked 0 Times in 0 Posts
Default Dynamic Text in Label

How do I get the value of 'it' in the text part of the label? I just keep on getting '<% =it %>' as a text in the html code.

Appreciate your comment.

<div id="MyTop" style="position: static; width: 800px; height: 300px; background-color: #9c6;">
        Dim it As Integer = 1
        For it = 1 To 23
    <asp:Label runat="server" Text="<% =it %>"></asp:Label>
    <% ....

Reply With Quote
  #2 (permalink)  
Old September 18th, 2006, 10:22 AM
Authorized User
Join Date: Sep 2006
Location: Bangalore, Karnataka, India.
Posts: 19
Thanks: 0
Thanked 0 Times in 0 Posts

The code you are trying is the ASP kind of style, with asp.net 2.0 what you can do is in the page load write a piece of code like this

first in the aspx file <asp:Label runat="server" Text="" id="txt1"></asp:Label>

then in the .aspx.vb or .aspx.cs files in the page_load write the following code
txt1.text = value - for anyone Vb or CS syntax.

Check and see if this helps, else will try and help you better. Also give us an idea what scenario you plan to use it for.

Vincent Thomas
Reply With Quote
  #3 (permalink)  
Old September 18th, 2006, 12:59 PM
Registered User
Join Date: May 2006
Location: , , Austria.
Posts: 7
Thanks: 0
Thanked 0 Times in 0 Posts

Thanks, I have decided to create the label in the code behind. Thank you for your comment.

Reply With Quote

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

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 Off
HTML code is Off
Trackbacks are Off
Pingbacks are On
Refbacks are Off

Similar Threads
Thread Thread Starter Forum Replies Last Post
Center Text within Label testsubject Visual Studio 2005 5 October 15th, 2011 12:59 PM
Need Help with Dynamic Link Label Click Events chobo2 C# 4 November 8th, 2007 03:47 AM
Label Array With Dynamic Size nevincm C# 1 April 13th, 2007 11:24 AM
Create dynamic label in vb.net snowydust VB How-To 1 July 24th, 2004 05:32 AM

All times are GMT -4. The time now is 09:58 PM.

Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
© 2013 John Wiley & Sons, Inc.