473,406 Members | 2,273 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,406 software developers and data experts.

C sharp XML question

Hello All

I have the following xml:
Expand|Select|Wrap|Line Numbers
  1.  
  2. <menu>
  3.  
  4.   <photo image="http://bytes.com/images/tundra-2wd.jpg" url="http://www.example.com" target="_blank"><![CDATA[Test drive it!!]]></photo>
  5.  
  6.   <photo image="http://bytes.com/images/tundra.jpg" url="http://www.example.com" target="_blank"><![CDATA[Test drive it!!]]></photo>
  7.  
  8. </menu>
  9.  
An i want to insert another elemnt like this:
Expand|Select|Wrap|Line Numbers
  1.   <photo image="http://bytes.com/images/new.jpg" url="http://www.new.com" target="_blank"><![CDATA[new!!]]></photo>
  2.  
So it will look like this:
Expand|Select|Wrap|Line Numbers
  1. <menu>
  2.  
  3.   <photo image="http://bytes.com/images/tundra-2wd.jpg" url="http://www.example.com" target="_blank"><![CDATA[Test drive it!!]]></photo>
  4.  
  5.   <photo image="http://bytes.com/images/tundra.jpg" url="http://www.example.com" target="_blank"><![CDATA[Test drive it!!]]></photo>
  6.  
  7.   <photo image="http://bytes.com/images/new.jpg" url="http://www.new.com" target="_blank"><![CDATA[new!!]]></photo>
  8.  
  9. </menu>
  10.  
  11.  
  12.  
How do I achieve this in C Sharp and ASP.net
Jan 7 '11 #1
3 1862
HaLo2FrEeEk
404 256MB
You need to end and re-start your code tags for each portion of code that you want to post. Also, you could eliminate all of the blank in your posted code, reducing 29 lines down to 10.

Before I give you any information as to what you should do, convince me that you've tried. We're not going to do your work for you unless we see that you've tried to figure it out on your own.
Jan 7 '11 #2
GaryTexmo
1,501 Expert 1GB
I agree with Halo that you should clean up your OP so that other people coming in and seeing your thread have an easier time of reading it :)

As for your actual question, you'll want to take a look at the AppendChild method of the XmlNode object. Here's an MSDN link...

http://msdn.microsoft.com/en-us/libr...pendchild.aspx

(It's worth noting that while an example is provided, that may not be exactly what you need. This should put you on the right track though... if you have troubles, please let us know!)
Jan 7 '11 #3
HaLo2FrEeEk
404 256MB
And to supplement Gary's last statement (in parentheses), if the example provided on that page isn't exactly what you need, then try to figure out the problem with the information you have been given. Google is an absolute Godsend in situations like this, use it! We're not here to do your work for you, but we want to help you learn. Show us that you want to learn HOW to do it and now just have it done for you, and we'll be more than happy to help.
Jan 7 '11 #4

Sign in to post your reply or Sign up for a free account.

Similar topics

50
by: Jerry Sievers | last post by:
<venting> Fellow coders; I just get off the phone today with some clueless headhunter and after listing for her (very proudly I might add) my OS and dev tools platforms of choice; ...
20
by: The LoxFather | last post by:
Coming from a VB background, which should .NET language should I learn....C++ or C Sharp. Is C++ going to be dead soon?
4
by: Baskar RajaSekharan | last post by:
Please clarify My doubt.. 1) How to find out whether the component devekopment in Csharp is in Relase Mode or Run Mode? 2) Like Class Id in C++ , what the Unique Id for C-shap Component?
4
by: Hai Nguyen | last post by:
I'm learning C sharp and do not like vb much. I'm creatiing a wepage using panel to test myself. I tried to use these code below, which is written in VB, and to transform them to c sharp but I got...
2
by: HishHish | last post by:
I have a Java code that I want to convert it to C-sharp in order to put it in my ASP.NET web application. I used the JLCA (Java Language Conversion Assistant) for conversion, but it gave me many...
8
by: John Salerno | last post by:
Ok, I'm still a little confused about how to use the command line with the C# compiler that came with the SDK. I get a message saying the command isn't recognized, so I guess I'm in the wrong...
7
by: jimi_xyz | last post by:
I am kind of new to C sharp; I have a quick question I have multiple text boxes 12 of them to be exact. What I want to do is fill them with values that are in a array of integers. The way I am...
20
by: windandwaves | last post by:
Hi Folk I am a PHP programmer, but I like to learn c-sharp as it seems to be in hot demand around here. My questions are: - how does c-sharp relate to PHP - do you like c-sharp and its...
3
by: Gandalf | last post by:
Sharp effect is one of the photoshop effect on letters. some one a javascript script that create the same effect? thanks
2
complete
by: complete | last post by:
What is the point of using set and get in C Sharp? It seems variables are used differently in this language than in C++. For some reason, you have to have a static variable defined like this:...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
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...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
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...

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.