473,659 Members | 2,944 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Adding HTML tags to data from SQL server

Adding HTML tags to data from SQL server

When dragging a table on to a web form in an ASP.NET 2.0 application, the
connection is established and the data is displayed in a DataGrid. Is it
possible to manipulate the selected data before it is displayed as HTML
data. E.g adding some HTML tags to the value of a datafield.

TIRislaa
Nov 9 '06 #1
1 1885
Hi,

1. You can change sql query which you use for selecting data. And use
concatenation. For example:

select FirstName + ', ' + LastName from dbo.Users

2. You can setup apperance of each column in DataGrid control. For
this, list all columns between <Columnsand </Columnstags:

<Columns>
....
<asp:TemplateCo lumn HeaderText="Nam e">
<ItemTemplate >
<%# Eval("FirstName ") %>, <%# Eval("LastName" ) %>
</ItemTemplate>
</asp:TemplateCol umn>
....
</Columns>

For more information refer msdn
(http://msdn2.microsoft.com/en-us/lib...datagrid.aspx).

3. You can change the value of each rows redeclaring DataBinding event
of DataGrid -
http://msdn2.microsoft.com/en-us/lib...tabinding.aspx.

If it's just design purpose then method #2 fits the best.

Alexander Kleshchevnikov
www.klalex.com

"""Tor Inge Rislaa ÐÉÓÁÌ(Á):
"""
Adding HTML tags to data from SQL server

When dragging a table on to a web form in an ASP.NET 2.0 application, the
connection is established and the data is displayed in a DataGrid. Is it
possible to manipulate the selected data before it is displayed as HTML
data. E.g adding some HTML tags to the value of a datafield.

TIRislaa
Nov 9 '06 #2

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

Similar topics

18
3745
by: Shannon Jacobs | last post by:
Trying to solve this with a regex approach rather than the programmatic approach of counting up and down the levels. I have a fairly complicated HTML page that I want to simplify. I've been able to mung most of it using several regular expressions, but I've become stuck at this point. I can't figure out how to grab only the <tr> tags that are associated with tables that are two levels deep. I feel like I got close, but it seems that...
4
1877
by: Kjell Arne | last post by:
Hi, How do one add parameters to a URL from a UserControl? My problem is that I want to set a unique value to the webpage when the page loads. This value I will use as a identifier for that session (user). I'm certain it's a simple solution for this. But I have not been able to locate it yet. Usually in the old days, I would just generate input hidden tags in the
1
6971
by: Jax | last post by:
I am looking to populate web page with controls as a result of a database query. eg (pseudocode) <% foreach(Garment g in GetStuffFromDB()) { //add controls Response.Write("<asp:Button id = 'Button'"+ctr.ToString() +"/>")
7
2040
by: | last post by:
What is the beat way to dynamically write/add to the HEAD tag of an ASPX page (the <head runat=server ... is too error prone and not very repeatable)? Thanks.
3
4871
by: Jim Heavey | last post by:
Trying to figure out the technique which should be used to add rows to a datagrid. I am thinking that I would want an "Add" button on the footer, but I am not quite sure how to do that. Is that the best method? Do you have a sample of how to do this?
10
3101
by: Barry L. Camp | last post by:
Hi all... hope someone can help out. Not a unique situation, but my search for a solution has not yielded what I need yet. I'm trying to come up with a regular expression for a RegularExpressionValidator that will allow certain HTML tags: <a>, <b>, <blockquote>, <br>, <i>, <img>, <li>, <ol>, <p>, <quote>, <ul>
2
15065
by: ChrisCicc | last post by:
Hi All, I got a real doozy here. I have read hundreds upon hundreds of forum posts and found numerous others who have replicated this problem, but have yet to find a solution. Through testing I have been able to find the cause of the problem, and will describe it here first textually and then through a code example. The purpose of what I am trying to do is to create a postback-free web application through the use of ASP.net AJAX UpdatePanels...
1
1844
by: CapRand | last post by:
Hi, I am creating an ASP.NET site and have created a form which I have been able to dynamically with listboxes, labels etc from a database - using mainly form1.Controls.Add ..... Does anyone know how I can add blank lines to a form. If I use response.write it writes to the body of the HTML and not inside the form. I am sure it must be easy but it has got me stuck. I have tried adding a label with vbcrlf inside it but the CRLF stays...
15
5263
by: lxyone | last post by:
Using a flat file containing table names, fields, values whats the best way of creating html pages? I want control over the html pages ie 1. layout 2. what data to show 3. what controls to show - text boxes, input boxes, buttons, hyperlinks ie the usual. The data is not obtained directly from a database.
0
8335
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 effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
8747
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 tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
1
8528
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 Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
8627
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 protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
7356
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
1
6179
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
5649
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
4335
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
2752
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system

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.