XmlDataSource & XPATH & DataList

G

Guest

i am using the XmlDataSource +DataList to get xml
and in the aspx page itself to extract data i do for exmlae:
<%#XPath("LogoBg/text()")%>
what i want to do is :
Dim index As Integer =
XmlDataSource1.GetXmlDocument.SelectNodes("MainPage/ParentsTip").Count
index = rand.Next(index)
parentTipText =
XmlDataSource1.GetXmlDocument.SelectNodes("MainPage/ParentsTip").ItemOf(index).InnerText

which today i do in the ASPX.VB page
and i want it (if possible) to be done in the aspx page itself
is it possible?
thnaks in advance
peleg
 
G

Guest

Hi,
yes it is possible.
There are two types of coding style in ASP.NET.
[1]Inline Coding and [2]Code Behind
Presently you are using Code Behind style.
When u provide Design part code and Logic part code within a single file
called as ASPX,then it is INLINE ,where as
When u provide Design part code within ASPX file and Logic part code within
DLL file, then it is 'CODE BEHIND'.
AND

PROBLEMS WITH INLINE:-

INLINE doesnot support parallel Development of Designing part and Logic part
because single file has to be shared by the WebDesigner and WebDeveloper.
So,This leads to TIME CONSUMPTION.
and also
INLINE doesnot provide SECURITY for Logic part.

CODEBEHIND will overcome all the sbove problems of INLINE.
In asp.net INLINE is used only for migration purpose.
Below link further illustrates how you can write Inline and Code Behind in
ASP.NET
http://www.codeproject.com/aspnet/I...asp?df=100&forumid=100399&exp=0&select=997793
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,996
Messages
2,570,238
Members
46,826
Latest member
robinsontor

Latest Threads

Top