TECHNOLOGIES
FORUMS
JOBS
BOOKS
EVENTS
INTERVIEWS
Live
MORE
LEARN
Training
CAREER
MEMBERS
VIDEOS
NEWS
BLOGS
Sign Up
Login
No unread comment.
View All Comments
No unread message.
View All Messages
No unread notification.
View All Notifications
Answers
Post
An Article
A Blog
A News
A Video
An EBook
An Interview Question
Ask Question
Forums
Monthly Leaders
Forum guidelines
Shelby Poston
NA
42
0
How do I create a xml file from stored session variables
Feb 18 2011 2:57 PM
I am trying to dynamically create a XML file from data when it is stored into a session.
Then retrieve it the XML data from another page and map to a different set of columns.
Is this possible, if so can you give an example of the code.
Code I have written.
this recreates the file but no data is there.
public virtual void Button_Click(object sender, EventArgs args)
{
RegistrationTableControl recControls = (RegistrationTableControl)this.Page.FindControlRecursively("RegistrationTableControl");
if (recControls != null)
{
RegistrationTableControlRow[] rows = recControls.GetSelectedRecordControls();
this.Page.Session["RegistrationTableControl"] = rows;
XmlTextWriter writer = new XmlTextWriter(@"c:\\temp\\reg.xml", System.Text.Encoding.UTF8);
}
public RegistrationTableControlRow[] GetSelectedRecordControls()
{
ArrayList selectedList = new ArrayList(25);
foreach (RegistrationTableControlRow recControl in this.GetRecordControls())
{
if (recControl.RegistrationRecordRowSelection.Checked) {
selectedList.Add(recControl);
}
}
return (RegistrationTableControlRow[])(selectedList.ToArray(Type.GetType("MBSolutions.UI.Controls.ShowRegistrationTablePage.RegistrationTableControlRow")));
}
Reply
Answers (
1
)
how to set the vale in Drop down in gridview template Colums
How to handle null value during convert a column into a string array