I am looking for the best solution for this scenario:
ASP.NET needs display an editable form with 20 textboxes. Data source is
xml. Xml must be updated. if user clicks Update button on the form.
Scenario 1 - brute force
Load xml into XmlDocument,
txtName.Text = doc.SelectSingleNode ('\\bla\@dotnet.itags.org.bla").Value
private void OnNameChanged(object sender, System.EventArgs e)
{
doc.SelectSingleNode ("\\bla\@dotnet.itags.org.bla").Value = txtName.Text
}
Scenario 2 - databinind
Load DataSet from xml, hook up text box with dataset in txtName_Databinding
event I am not sure if it will work both ways.
Scenario 3 - Xml data island
I worked well in the past, not sure if it is still the best way to go..
I appreciate any opinions on that subject
-StanI've not yet tried it myself, but have you considered using an XmlDataDocume
nt?
Perhaps you can use the ObjectDataSource, build your own class that does
the Selects and Updates and then passback the XmlDataDocument as your storag
e
mechanism? If I had the time, it'd make for an interesting experiment.
-Brock
DevelopMentor
http://staff.develop.com/ballen
> I am looking for the best solution for this scenario:
> ASP.NET needs display an editable form with 20 textboxes. Data source
> is xml. Xml must be updated. if user clicks Update button on the form.
> Scenario 1 - brute force
> Load xml into XmlDocument,
> txtName.Text = doc.SelectSingleNode ('\\bla\@.bla").Value
> private void OnNameChanged(object sender, System.EventArgs e)
> {
> doc.SelectSingleNode ("\\bla\@.bla").Value = txtName.Text
> }
> Scenario 2 - databinind
> Load DataSet from xml, hook up text box with dataset in
> txtName_Databinding
> event I am not sure if it will work both ways.
> Scenario 3 - Xml data island
> I worked well in the past, not sure if it is still the best way to
> go..
> I appreciate any opinions on that subject
> -Stan
>
I cannot use XmlDataDocument because xml comes out of sql server directly
(FOR XML EXPLICIT) and there is no dataset (doc = new XmlDataDocument (ds))
ObjectDataSource is from NET 2.0 and I forgot to mention that this is in
1.1. Yes a lot of things will be simpler in 2.0, especially xml and object
databinding
One of the problem is that even with xml databinding I can bind control on
the server, but after postback this binding is lost, similar with DataGrid.
I guess there is no magic way to do that..
"Brock Allen" <ballen@.NOSPAMdevelop.com> wrote in message
news:642564632508223731954000@.msnews.microsoft.com...
> I've not yet tried it myself, but have you considered using an
XmlDataDocument?
> Perhaps you can use the ObjectDataSource, build your own class that does
> the Selects and Updates and then passback the XmlDataDocument as your
storage
> mechanism? If I had the time, it'd make for an interesting experiment.
> -Brock
> DevelopMentor
> http://staff.develop.com/ballen
>
>
>
>
Oh yeah... If you're in v1.1 then there's no two-way databinding at all.
You'll have to code it all manually. Sorry.
-Brock
DevelopMentor
http://staff.develop.com/ballen
> I cannot use XmlDataDocument because xml comes out of sql server
> directly (FOR XML EXPLICIT) and there is no dataset (doc = new
> XmlDataDocument (ds))
> ObjectDataSource is from NET 2.0 and I forgot to mention that this is
> in 1.1. Yes a lot of things will be simpler in 2.0, especially xml and
> object databinding
> One of the problem is that even with xml databinding I can bind
> control on the server, but after postback this binding is lost,
> similar with DataGrid. I guess there is no magic way to do that..
> "Brock Allen" <ballen@.NOSPAMdevelop.com> wrote in message
> news:642564632508223731954000@.msnews.microsoft.com...
>
> XmlDataDocument?
>
> storage
>
Subscribe to:
Post Comments (Atom)
0 comments:
Post a Comment