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

mixing html source with code behind

can i mix the code behind page variables with html source ?
for examle in asp we insert <% %>
i want to connect to my db and with response.write , show it in a table

thanks

Jan 25 '07 #1
4 1593
Yes, you can, but this is not how you do things in asp.net. Asp.net is
object-oriented as opposed to asp that is procedure-oriented. To show the
database content in a table, you should use an asp.net control like GridView
and databind it to your database table. If you use declarative databinding
with DataSourceID property, you can get it done without writing any single
line of code. You will get annoyed and frustrated very soon if you will try
using asp.net in the asp fashion.

--
Eliyahu Goldin,
Software Developer & Consultant
Microsoft MVP [ASP.NET]
http://msmvps.com/blogs/egoldin
http://usableasp.net
<mi********@gmail.comwrote in message
news:11**********************@j27g2000cwj.googlegr oups.com...
can i mix the code behind page variables with html source ?
for examle in asp we insert <% %>
i want to connect to my db and with response.write , show it in a table

thanks

Jan 25 '07 #2
thanks for your answer
but i don't want to use gridview
it is limited and i want to make my table in html source
i don't want to change the construction of my site

Jan 25 '07 #3
This is absolutely fine to use an html table. The point is not what control
you are using but how you build the page. Instead of writting directly to
the response stream you could specify what object you want to see in the
rows and databind them. You would likely want to use a repeater in the
following way:

<table>
<asp.repeater ... >
<itemtemplate>
<tr>
<td>some controls</td>
....
<td>some other controls</td>
</tr>
</itemtemplate>
</asp.repeater>
</table>

--
Eliyahu Goldin,
Software Developer & Consultant
Microsoft MVP [ASP.NET]
http://msmvps.com/blogs/egoldin
http://usableasp.net
<mi********@gmail.comwrote in message
news:11*********************@v45g2000cwv.googlegro ups.com...
thanks for your answer
but i don't want to use gridview
it is limited and i want to make my table in html source
i don't want to change the construction of my site

Jan 28 '07 #4
thanks
so i think must use repeater control

Jan 29 '07 #5

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

Similar topics

4
by: Cristian Tota | last post by:
Hi, I'd appreciate any thoughts on mixing C++ and C code. I have a project that uses a given C interface, the rest of the project can be either in C or C++. What would be the recomended design...
4
by: VR | last post by:
Hi. I have an ASP.NET web page, with a logo written in plain HTML. One of the tags is an image that should read either "sign on" or "sign off" depending on whether a user has been...
17
by: Lloyd Sheen | last post by:
This IDE is driving me nuts. I needed another button so I copied an existing one, changed the Text and the id and position by drag and drop. Well then I run and get the following: Control...
3
by: Norm via DotNetMonster.com | last post by:
I had a similar problem as Ferdi - 19 Aug 2003 - "Postback after carriage return input" where pressing the enter key would postback my asp textboxes prematurely - I want the user to click on a...
5
by: Shawn Repphan | last post by:
I have a webform with about 20 html textboxes and checkboxes. I am using ICallbackEventHandler to page through these successfully. But I need to be able to accept changes from these fields. How can...
7
by: Ubantu Rococo | last post by:
Hi all, Sorry for this stupid question, but I am having trouble mixing imagecopy etc. with HTML. What I am trying to do is copy an image, and then obtain co-ordinates from a database which will...
6
by: ziman137 | last post by:
Hello all, I have a question and am seeking for some advice. I am currently working to implement an algorithmic library. Because the performance is the most important factor in later...
3
by: jason | last post by:
I've been working with C# for over a year now without touching vb.net code. I had a few light years of vb.net before that. No real vb6 or windows form experience. Suddenly, I have an assignment...
0
by: John Scheldroup | last post by:
Source: Article Mixing C and C++ Code in the Same Program By Stephen Clamage, Sun Microsystems, Sun ONE Studio Solaris Tools Development Engineering ...
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: 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: 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...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
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...
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
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
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...

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.