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

Custom databinding of a text box

vwd 2005 express.

when editing the CUSTOM databinding of a text box in a FormViews
"ItemTemplate" I'd like to do this:

Bind("[FirstName] & ' ' & [LastName]")

Or if you prefer, this is the resultant ASP code from setting the property
above:
<asp:Label ID="FirstNameLabel" runat="server" Text="<%#
Bind(&quot;[FirstName] & ' ' & [LastName]&quot;) %>"
Width="312px"></asp:Label>

but that doesn't work. How do I construct the string so that the result is
the concatenation of the FirstName and the LastName?

Thanks,

Keith
Feb 9 '08 #1
3 1467
I should point out that I know I can modify my SQL statement to return a
column of the concatenated values or use a view that does the same. HOWEVER,
one of the things many of the SQL gurus yell at everyone for over and over
and over is DO THE FORMATTING IN THE CLIENT SIDE!!! NOT THE SQL SIDE!!!. I
don't always agree with that philosophy but I'd like to know how to do this
on the ASP side of things if it's possible.

Keith
"Keith G Hicks" <kr*@comcast.netwrote in message
news:OH*************@TK2MSFTNGP02.phx.gbl...
vwd 2005 express.

when editing the CUSTOM databinding of a text box in a FormViews
"ItemTemplate" I'd like to do this:

Bind("[FirstName] & ' ' & [LastName]")

Or if you prefer, this is the resultant ASP code from setting the property
above:
<asp:Label ID="FirstNameLabel" runat="server" Text="<%#
Bind(&quot;[FirstName] & ' ' & [LastName]&quot;) %>"
Width="312px"></asp:Label>

but that doesn't work. How do I construct the string so that the result is
the concatenation of the FirstName and the LastName?

Thanks,

Keith


Feb 9 '08 #2
Hello Keith
It's posible, just help with String.Concat, and Eval dataitem not use
Bind...
Example:
<asp:FormView ID="FormView1"
....
<ItemTemplate>
....
<asp:Label ID="lblDesc" runat="server" Text='<%#
String.Concat(Eval("CategoryID"), Eval("Description"),
Eval("CategoryID")) %>'>
....
Links:
-----------------
String..Concat Method
Concatenates one or more instances of String, or the String
representations of the values of one or more instances of Object.
http://msdn2.microsoft.com/en-us/lib...ng.concat.aspx

I hope that you will help or guide
______________________
Jose A. Fernandez
blog: http://geeks.ms/blogs/fernandezja


On 9 feb, 21:48, "Keith G Hicks" <k...@comcast.netwrote:
I should point out that I know I can modify my SQL statement to return a
column of the concatenated values or use a view that does the same. HOWEVER,
one of the things many of the SQL gurus yell at everyone for over and over
and over is DO THE FORMATTING IN THE CLIENT SIDE!!! NOT THE SQL SIDE!!!. I
don't always agree with that philosophy but I'd like to know how to do this
on the ASP side of things if it's possible.

Keith

"Keith G Hicks" <k...@comcast.netwrote in messagenews:OH*************@TK2MSFTNGP02.phx.gbl.. .
vwd 2005 express.
when editing the CUSTOM databinding of a text box in a FormViews
"ItemTemplate" I'd like to do this:
Bind("[FirstName] & ' ' & [LastName]")
Or if you prefer, this is the resultant ASP code from setting the property
above:
<asp:Label ID="FirstNameLabel" runat="server" Text="<%#
Bind(&quot;[FirstName] & ' ' & [LastName]&quot;) %>"
Width="312px"></asp:Label>
but that doesn't work. How do I construct the string so that the result is
the concatenation of the FirstName and the LastName?
Thanks,
Keith
Feb 10 '08 #3
Thank you.

"Jose A. Fernandez" <fe*********@gmail.comwrote in message
news:6f**********************************@v67g2000 hse.googlegroups.com...
Hello Keith
It's posible, just help with String.Concat, and Eval dataitem not use
Bind...
Example:
<asp:FormView ID="FormView1"
....
<ItemTemplate>
....
<asp:Label ID="lblDesc" runat="server" Text='<%#
String.Concat(Eval("CategoryID"), Eval("Description"),
Eval("CategoryID")) %>'>
....
Links:
-----------------
String..Concat Method
Concatenates one or more instances of String, or the String
representations of the values of one or more instances of Object.
http://msdn2.microsoft.com/en-us/lib...ng.concat.aspx

I hope that you will help or guide
______________________
Jose A. Fernandez
blog: http://geeks.ms/blogs/fernandezja


On 9 feb, 21:48, "Keith G Hicks" <k...@comcast.netwrote:
I should point out that I know I can modify my SQL statement to return a
column of the concatenated values or use a view that does the same.
HOWEVER,
one of the things many of the SQL gurus yell at everyone for over and
over
and over is DO THE FORMATTING IN THE CLIENT SIDE!!! NOT THE SQL SIDE!!!.
I
don't always agree with that philosophy but I'd like to know how to do
this
on the ASP side of things if it's possible.

Keith

"Keith G Hicks" <k...@comcast.netwrote in
messagenews:OH*************@TK2MSFTNGP02.phx.gbl.. .
vwd 2005 express.
when editing the CUSTOM databinding of a text box in a FormViews
"ItemTemplate" I'd like to do this:
Bind("[FirstName] & ' ' & [LastName]")
Or if you prefer, this is the resultant ASP code from setting the
property
above:
<asp:Label ID="FirstNameLabel" runat="server" Text="<%#
Bind(&quot;[FirstName] & ' ' & [LastName]&quot;) %>"
Width="312px"></asp:Label>
but that doesn't work. How do I construct the string so that the
result is
the concatenation of the FirstName and the LastName?
Thanks,
Keith

Feb 10 '08 #4

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

Similar topics

3
by: DraguVaso | last post by:
Hi, I'm having the following situation: - A class clsFournisseur with public property's which raise a MyPropertyChanged-event in the Set-method for each Property. Public Event NomChanged As...
2
by: Jay Walker | last post by:
I created a custom DataGridColumn based on Marcie Robillard's MSDN Article: Creating Custom Columns for the ASP.NET Datagrid...
3
by: DraguVaso | last post by:
Hi, I'm having the following situation: - A class clsFournisseur with public property's which raise a MyPropertyChanged-event in the Set-method for each Property. Public Event NomChanged As...
9
by: Jaybuffet | last post by:
my aspx has something like this <asp:Repeater id="Repeater1" runat="server"> <ItemTemplate> <mycontrol:ctl id="ctlId" obj='<%# Container.DataItem %>' showItem="true"/> </ItemTemplate>...
1
by: Charles Bazi | last post by:
Hi, Based on MSDN http://msdn2.microsoft.com/en-us/library/7tas5c80.aspx smple, I have made my custom DataGridViewColumn. I use it to host a custom control, sort of ComboBox, but instead of...
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: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
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
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
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:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...

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.