lwfoon

I need some help here. Bascally, I need to bind the XML data into my ASP.NET website. I successfully bind it into my dropdownlist. But I have no idea to bind it into my textbox. I just want to display a personal membership folder.

Can anyone help me

I really blur now.

No database using. All the data were stored in the XML file.




Re: ASMX Web Services and XML Serialization Beginner need help here about ASP.NET and XML

rfreire

Hi foo,

Databinding is usually more straightforward with list controls as they provide specific properties for that (DataSource, DisplayMember, etc).

For non-list controls like a Textbox you may use a binding expression in the control tag.... this would be an explicit binding using a property or method from the code-beside, here you have an example:

ASPX

<asp:TextBox ID="TextBox1" Text="<%# GetText() %>" runat="server"></asp:TextBox>

Code-beside

public string GetText()

{

System.Xml.XmlDocument doc = new System.Xml.XmlDocument();

/// XML data extraction here....

return value;

}

This way you have a flexible binding approach for textboxes.... GetText can be either a method as is or a Text property if you want.

Rgds,

Rodrigo