473,698 Members | 2,434 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Databinding Expressions & Page Rendering Sequence

Ive got the basic idea behind DataBinding Expressions, but I have a couple
of questions, Ok its four actually :)

Q1.) It would appear that if you use Page.DataBind that all child controls
and the page get bound to their respective DataSources, is this correct ?
and if so why would you need to individually bind controls, why not jsut use
Page.DataBind everytime?, Im sure there is a good reason why not but I cant
think of one at the moment.

Q2.) The phase Container.DataI tem seems to be able to appear either on its
own or within the DataBinder.Eval static function. I cant seem to find a
cohesive paper on the net that really explains well the Container.DataI tem,
and where and how it should be used.

So far I have been able to bind stuff like a class level variable called
page title and have that display in a reapeater header template and also
bind things like arrays to the repeater and this works fine. But as the
array does not have a propertyname using DataBinder.Eval does not work, you
need to use Container.DataI tem

Q3.) When are the DataBinding expressions evaluated ? is it just before or
after the pre-render event, or somewhere else. ?
So some pointers to a well written paper would be great or a self
explaination would be really good as well.

Q4.) When the page is rendered for response to the browser, does anyone have
a pointer to a paper which outlines in which order the HTML is built.

Many Thanks.
Nov 19 '05 #1
2 1686
1) Some of your controls will use ViewState. There is no reason to rebind
them, so you only rebind those controls that need to be rebound. If this
scenario does not fit your app, then Page.DataBind() is fine.

2) DataBinder.Eval should only be used when you need to parse from type to
type. The Eval() method will help figure out the proper means of casting. If
you are already typed, this is not a necessary step and adds weight that is
not needed. In your case, Container.DataI tem is more prudent.

With the last two items, the following may help, although I am not sure they
are deep enough:

http://aspalliance.com/articleViewer.aspx?aId=134
http://www.codeproject.com/aspnet/EventsWebPage.asp

--
Gregory A. Beamer
MVP; MCP: +I, SE, SD, DBA

*************** ************
Think Outside the Box!
*************** ************
"Mr Newbie" wrote:
Ive got the basic idea behind DataBinding Expressions, but I have a couple
of questions, Ok its four actually :)

Q1.) It would appear that if you use Page.DataBind that all child controls
and the page get bound to their respective DataSources, is this correct ?
and if so why would you need to individually bind controls, why not jsut use
Page.DataBind everytime?, Im sure there is a good reason why not but I cant
think of one at the moment.

Q2.) The phase Container.DataI tem seems to be able to appear either on its
own or within the DataBinder.Eval static function. I cant seem to find a
cohesive paper on the net that really explains well the Container.DataI tem,
and where and how it should be used.

So far I have been able to bind stuff like a class level variable called
page title and have that display in a reapeater header template and also
bind things like arrays to the repeater and this works fine. But as the
array does not have a propertyname using DataBinder.Eval does not work, you
need to use Container.DataI tem

Q3.) When are the DataBinding expressions evaluated ? is it just before or
after the pre-render event, or somewhere else. ?
So some pointers to a well written paper would be great or a self
explaination would be really good as well.

Q4.) When the page is rendered for response to the browser, does anyone have
a pointer to a paper which outlines in which order the HTML is built.

Many Thanks.

Nov 19 '05 #2
Thanks for your answers Greg,

The articles you pointed through on first glance look worth a good read so I
will do that. I like to get down to the nitty gritty and really understand
things as much as I can as I allways feel it gives one a more complete and
thorough understanding. The problem with this sort of thing is that the
information one needs to do that is often dispersed all over the world.
Regards Mr Newbie

"Cowboy (Gregory A. Beamer) - MVP" <No************ @comcast.netNoS pamM> wrote
in message news:A4******** *************** ***********@mic rosoft.com...
1) Some of your controls will use ViewState. There is no reason to rebind
them, so you only rebind those controls that need to be rebound. If this
scenario does not fit your app, then Page.DataBind() is fine.

2) DataBinder.Eval should only be used when you need to parse from type to
type. The Eval() method will help figure out the proper means of casting.
If
you are already typed, this is not a necessary step and adds weight that
is
not needed. In your case, Container.DataI tem is more prudent.

With the last two items, the following may help, although I am not sure
they
are deep enough:

http://aspalliance.com/articleViewer.aspx?aId=134
http://www.codeproject.com/aspnet/EventsWebPage.asp

--
Gregory A. Beamer
MVP; MCP: +I, SE, SD, DBA

*************** ************
Think Outside the Box!
*************** ************
"Mr Newbie" wrote:
Ive got the basic idea behind DataBinding Expressions, but I have a
couple
of questions, Ok its four actually :)

Q1.) It would appear that if you use Page.DataBind that all child
controls
and the page get bound to their respective DataSources, is this correct ?
and if so why would you need to individually bind controls, why not jsut
use
Page.DataBind everytime?, Im sure there is a good reason why not but I
cant
think of one at the moment.

Q2.) The phase Container.DataI tem seems to be able to appear either on
its
own or within the DataBinder.Eval static function. I cant seem to find a
cohesive paper on the net that really explains well the
Container.DataI tem,
and where and how it should be used.

So far I have been able to bind stuff like a class level variable called
page title and have that display in a reapeater header template and also
bind things like arrays to the repeater and this works fine. But as the
array does not have a propertyname using DataBinder.Eval does not work,
you
need to use Container.DataI tem

Q3.) When are the DataBinding expressions evaluated ? is it just before
or
after the pre-render event, or somewhere else. ?
So some pointers to a well written paper would be great or a self
explaination would be really good as well.

Q4.) When the page is rendered for response to the browser, does anyone
have
a pointer to a paper which outlines in which order the HTML is built.

Many Thanks.

Nov 19 '05 #3

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

Similar topics

6
6733
by: eye5600 | last post by:
Is there a cure for the problems using databinding with a DateTimePicker? I find that a) sometimes it works, sometimes it doesn't, and b) it fails silently causing all databinding on the DataSet to fail with a error message. Help!
1
1257
by: Vik | last post by:
Concatenation operator & used in the databinding expressions for the datagrid template columns appears as '&amp;' in HTML. It causes an error when opening the pages. I have to replace '&amp;' by '&' each time I edit the template column. Is there a way to avoid this problem? Thank you.
4
1651
by: Nathan Sokalski | last post by:
I have two databinding expressions (the first & last names from a DB) that I want to assign to the text property of a Label so that the result is LASTNAME,FIRSTNAME. At the moment, I have the following which I know works when I use it by itself: text='<%# DataBinder.Eval(Container,"DataItem.membernames.lname") %>' What I need to do is somehow concatenate this databinding expression, a comma, and another databinding expression for the...
6
2309
by: Nathan Sokalski | last post by:
I am using a DataSet as the DataSource of a DataList in my code. The SQL used to get the data from the database begins with: SELECT members.organization,artists.artist,artists.email,artists.website,members.email FROM members INNER JOIN artists ON members.memberid=artists.memberid WHERE Notice that both tables involved in the SELECT statement have a field named
1
1395
by: Nathan Sokalski | last post by:
When I run my application, which uses databinding in a DataList, I recieve the following error: Server Error in '/' Application. -------------------------------------------------------------------------------- Public member 'title' on type 'DataRowView' not found. Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it...
2
2244
by: mikeachamberlain | last post by:
Hi. I have an <asp:Imagecontrol in which I am databinding the ImageURL attribute. The URL is another ASPX page that provides the binary source of the image, The problem is that ASP.NET is insisting on HTML encoding the URL string, so the ampersands in the querystring are converted to &amps. As a simple example of this, consider the following:
2
1280
by: Sebastian | last post by:
Hi, I want to skin the templates of an asp:DataList. So I have to do data binding in the skin (I didn't find another comfortable way to do that). As soon there's a <%# ... %tag in the skin, VS seems not to recognize the skin file anymore. The property editor displays SkinID grayed out, and I cannot select anything. Interestingly, I can enter the SkinID by hand, and page rendering actually works!
59
7717
by: Andy Fish | last post by:
Hi, I am trying to output some html in monospaced font, and I want spaces to take up the same width as any other character. i thought this would be easy for monospaced fonts - surely &ensp; and &emsp; would both be the same width? unfortunately not - &ensp; is narrower than other characters and &emsp; is wider :-(
2
1443
by: =?Utf-8?B?U2F2dm91bGlkaXMgSW9yZGFuaXM=?= | last post by:
Which is the event sequence when a gridview button (for update) is clicked and the page is post back? I am also a bit confused when to use ..IsPostBack(). If my page data is changing maybe in every 10 or 20 seconds, should I use .IsPostback? If not, then the gridviews databinding in the page should be written in Page_Load or in the other events like SelectedIndexChanged, RowCommand where the click is handled? TIA Iordanis
0
8675
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 usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
8604
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
9029
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...
0
8862
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...
1
6521
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
5860
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
4370
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
0
4619
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
3050
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.