473,378 Members | 1,110 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,378 software developers and data experts.

Inline data

Is there a way to put inline data in a label?

For example, I would normally do something like this to put a name that I
have in my session variables in my asp:label:

Name.Text = Session("FullName")
....

<asp:Label ID ID="Name" runat="Server">

Can I get around the extra code by just doing something like (I know this
doesn't work):

<asp:Label ID="Name" Text='<%# session("FullName") %>' Runat="Server">

Similar to Binding to a variable, but get it directly from my session
variables?

Also, could I do a similar thing from a function (Obviously, if you can't do
the above - you probably can't do this):

<asp:Label ID="TotalAmount" Text='<%# MoneyFormat(Session("Total")) %>'
runat="Server"/>

Where MoneyFormat is a function I might use to format my session variable in
some money format.

Thanks,

Tom
Nov 19 '05 #1
2 1042
tshad wrote:
Is there a way to put inline data in a label?

For example, I would normally do something like this to put a name that I
have in my session variables in my asp:label:

Name.Text = Session("FullName")
...

<asp:Label ID ID="Name" runat="Server">

Can I get around the extra code by just doing something like (I know this
doesn't work):

<asp:Label ID="Name" Text='<%# session("FullName") %>' Runat="Server">

Similar to Binding to a variable, but get it directly from my session
variables?

Also, could I do a similar thing from a function (Obviously, if you can't do
the above - you probably can't do this):

<asp:Label ID="TotalAmount" Text='<%# MoneyFormat(Session("Total")) %>'
runat="Server"/>

Where MoneyFormat is a function I might use to format my session variable in
some money format.

Thanks,

Tom


not really inline but you could do it with the page load event in an
"inline" style... would that suffice?

--
Curt Christianson
site: http://www.darkfalz.com
blog: http://blog.darkfalz.com
Nov 19 '05 #2
"Curt_C [MVP]" <software_at_darkfalz.com> wrote in message
news:Oh**************@TK2MSFTNGP10.phx.gbl...
tshad wrote:
Is there a way to put inline data in a label?

For example, I would normally do something like this to put a name that I
have in my session variables in my asp:label:

Name.Text = Session("FullName")
...

<asp:Label ID ID="Name" runat="Server">

Can I get around the extra code by just doing something like (I know this
doesn't work):

<asp:Label ID="Name" Text='<%# session("FullName") %>' Runat="Server">

Similar to Binding to a variable, but get it directly from my session
variables?

Also, could I do a similar thing from a function (Obviously, if you can't
do the above - you probably can't do this):

<asp:Label ID="TotalAmount" Text='<%# MoneyFormat(Session("Total")) %>'
runat="Server"/>

Where MoneyFormat is a function I might use to format my session variable
in some money format.

Thanks,

Tom
not really inline but you could do it with the page load event in an
"inline" style... would that suffice?


Your just saying to do the Name.Text = Session("FullName") in the Page_Load
notPostback?

--
Curt Christianson
site: http://www.darkfalz.com
blog: http://blog.darkfalz.com

Nov 19 '05 #3

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

Similar topics

13
by: A | last post by:
Hi, I'm having problems completing a project in C++. I have been using inline functions in some of my header files. I have only done so for simple functions that only have 1 statement (eg....
23
by: Mat | last post by:
<div id="container"> <div id="main"> <div id="header"> <p class="Address">123 Fake Street, </p> <p class="City">Crazy City, </p> <p class="Province">Ontario </p> <p class="PostalCode">H0H...
5
by: Wah-chi Lai | last post by:
Hello all, I saw a function in a book with the return type is 'inline'. Is that a data type? How to use it? Where can I find further information about it? Thanks.
20
by: Grumble | last post by:
Hello everyone, As far as I understand, the 'inline' keyword is a hint for the compiler to consider the function in question as a candidate for inlining, yes? What happens when a function with...
5
by: Bert Jansen | last post by:
There seems to be a bug in de VS .net C++ compiler (optimization) when using inline functions that return static data. The following code demonstrates this (Win32 console app with ATL support): ...
3
by: yawnmoth | last post by:
http://us2.php.net/manual/en/function.imagegif.php#20425 The above URL suggests that it's possible to sorta embed images within an HTML document so that they don't have to be loaded via a...
2
by: Amal P | last post by:
Hi, This is the program that i made to test the usage of inline function. I am using vc 6.0 compiler. Please see the below program. int NonInline( int a, int b ) { return ( a b )? a: b; }
25
by: toton | last post by:
Hi, As inline is not mandetory, it depends on compiler to inline certain function (or using switch like fior GCC), my question is there any scope for inlining when it is not declared as inline...
2
by: aaragon | last post by:
Hi everyone, I would like to create a very simple function: // header file inline void point_map() { PointMap pointMap = get(vertex_point_t(), g); } // main.cpp
2
by: Nagrik | last post by:
Dear Group, The book of Bjarne Stroustrup in chapter 5.4.4 says the following "The word static is one of the most overused words in C and C++. For static data members it has both of the...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
0
by: ryjfgjl | last post by:
In our work, we often need to import Excel data into databases (such as MySQL, SQL Server, Oracle) for data analysis and processing. Usually, we use database tools like Navicat or the Excel import...
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: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
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: 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
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...

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.