473,569 Members | 2,611 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

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 1602
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********@gma il.comwrote in message
news:11******** **************@ j27g2000cwj.goo glegroups.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********@gma il.comwrote in message
news:11******** *************@v 45g2000cwv.goog legroups.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
1921
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 pattern in this case? C++ allows for a better design, but integrating the code with the C code isn't straight forward, it becomes rather messy. Code...
4
1920
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 authenticated: <a href="javascript:void(FollowLink('SignOn'));"> <IMG src="/graphics/TopSignOn.gif" name="TopSignOn"> </a>
17
2462
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 'Button19' of type 'Button' must be placed inside a form tag with runat=server Can the IDE not do what it is supposed to do. It seems that it is a...
3
1542
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 button after filling in the text boxes and pressing enter messes up my plans. Using Giscard's advice (onkeydown="return event.keyCode!=13")with HTML...
5
1519
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 I access an html field from ASP.net? Or better yet, how do I access server controls from javascript? The latter would be possible if ASP.net always...
7
2660
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 then be drawn on the image (to create a clickable imagemap). The image will then be displayed as part of a webpage. I've included my code snippet...
6
301
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 applications, I decide to write it in C instead of C++. However, I thought it might be convenient to use some C++ code at some misc places. I'm aware...
3
2090
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 where I've been asked to create a few new pages on an exsisting website. The website is written in vb.net with vb.net codebehind and classes. My...
0
1346
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 http://developers.sun.com/solaris/articles/mixing.html
0
7701
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main...
0
7924
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, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. ...
0
8130
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...
1
7677
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...
0
7979
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...
0
6284
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...
1
5514
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...
0
3643
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
2115
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.