|
This is so basic. You should go to Google and sreach for 'Read xml + c#'.
If you do not understand even after that, come back and show us what have you done. Some one would help you.
Manas Bhardwaj
Please remember to rate helpful or unhelpful answers, it lets us and people reading the forums know if our answers are any good.
|
|
|
|
|
Are you going to make a Soap Response Parser?
I think .NET automatically creates them for you.
You need to Add Web Reference to your project and you will get everything as an Object.
|
|
|
|
|
Piya B wrote: How can i get a single element and display it in a label.
You can do that with XPath *easily*. Load the XML to a XmlDocument class work with SelectSingleNode() method.
string xPath = "/soap:Envelope/soap:Body/dummy:TN_DetailsResp/dummy:PersNr";
XmlDocument document = new XmlDocument();
document.Load("your_xml");
XmlNamespaceManager nm = new XmlNamespaceManager(document.NameTable);
nm.AddNamespace("dummy", "http://tempuri.org/");
nm.AddNamespace("soap", "http://schemas.xmlsoap.org/soap/envelope/");
XmlNode node = document.SelectSingleNode(xPath, nm);
string result = node.InnerText; XPath is bit tricky here as your XML involves namespaces. dummy is a namespace prefix which I introduced as TN_DetailsResp node doesn't have any prefix.
Hope that helps.
|
|
|
|
|
Thanks for response N a v a n e e t h,
I got this also by :
XmlDocument doc = new XmlDocument();
doc.LoadXml(message);
XmlNodeList persid = doc.GetElementsByTagName("PersNr");
for (int _i = 0; _i < persid.Count; ++_i)
{
}
Just wondering, what's the difference between this and your solution?
|
|
|
|
|
Your code will get all elements whose name is PersNr anywhere in the document. The XPath example which I provided will look only in soap:Envelope/soap:Body/TN_DetailsResp .
|
|
|
|
|
Hi All
I'm facing problem while update and delete Items from ListView , it's data source point a table has 2 columns and both are composite primary keys
I faced that error
ObjectDataSource 'CourseSubjectDataSourse' could not find a non-generic method 'UpdateCourseSubject' that has parameters: original_CourseID, SubjectID, original_SubjectID.
while my UpdateCourseSubject method in the business layer like that
Public Function UpdateCourseSubject(ByVal SubjectID As Integer, ByVal original_CourseID As Integer) As Boolean<br />
Dim taCourseSubject As New dsTracksTableAdapters.CourseSubjectTableAdapter<br />
Dim dtCourseSubject As dsTracks.CourseSubjectDataTable = taCourseSubject.GetDataByCourseID(original_CourseID)<br />
If dtCourseSubject.Rows.Count = 0 Then Return False<br />
Dim rCourseSubject As dsTracks.CourseSubjectRow = dtCourseSubject.Rows(0)<br />
rCourseSubject.CourseID = original_CourseID<br />
rCourseSubject.SubjectID = SubjectID<br />
<br />
Dim rowsAffected As Integer = taCourseSubject.Update(dtCourseSubject)<br />
Return rowsAffected = 1<br />
End Function<br />
<br />
End Class
and the query sql statement in the dataset and table adapter like :
UPDATE CourseSubject<br />
SET SubjectID = @SubjectID<br />
WHERE (CourseID = @Original_CourseID)
can any one tell me what is the problem :S ??
thanks in advance
|
|
|
|
|
Hi
I have a tabcontainer with 3 tab panels..
Tabcontainer Autopostback is set to true.
Flickering is happen while moving from one tab to other tab..
How to avoid this issue..
Anybody's help would be appreciated..
Thanks in advance..
|
|
|
|
|
may be you can try the AjaxController 
|
|
|
|
|
Hello every one i have Tree View .i made a comtext menu on treeview.This contextmenu Having option like Add New,Edit,Delete.i got this ,But problem is that for add,edit,delete i have to get the selected node of Treeview.i am not getting the things.Please tell me the way.
|
|
|
|
|
use the below code to get selected treeview node text or value
For Each nodes As TreeNode In TreeView1.CheckedNodes
Response.Write(nodes.Text & "--" & nodes.Value & "")
Next
The miracle is this--the more we share, the more we have.
|
|
|
|
|
I uses the following code to dynamic fill the dropdownlist and forecolor of list item is set, it show good when first time load, but the style removes when the page postback...Any suggestion?
The code i use to fill dropdownlist is following...
Try
cnn.Open()
myreader = cmd.ExecuteReader()
While myreader.Read()
lst = New ListItem(myreader.GetValue(0).ToString().Trim(), myreader.GetValue(1).ToString().Trim())
If myreader.GetValue(2).ToString().Trim() = 0 Then
lst.Attributes.Add("style", "color:Red")
Else
lst.Attributes.Add("style", "color:Green")
End If
ddl.Items.Add(lst)
End While
ddl.DataBind()
Catch ex As Exception
Throw New Exception(ex.Message)
Finally
cnn.Close()
End Try
The miracle is this--the more we share, the more we have.
|
|
|
|
|
Why dont you apply the style again...
Use
if(IsPostBack)
ddl.Style.Add(HtmlTextWriterStyle.Color,"red")
|
|
|
|
|
I applid color based on the flag if the flag value in database =0 then the item color will red and if flag value is 1 then item color will green?...
The miracle is this--the more we share, the more we have.
|
|
|
|
|
yes .. then why dont you set the Database flag again during postback, and do set style accordingly.
|
|
|
|
|
how to call a javascript function from a linkbutton which is not in grid
|
|
|
|
|
At this time, every day, a ton of questions start getting posted. Most of them make no sense.
How do you call a javascript function from a link button ? You call it. How does it matter that it's not in a grid ? What are you trying to do exactly ? What have you written and what is going wrong ?
I can't work out how your question makes sense.
Christian Graus
Driven to the arms of OSX by Vista.
Read my blog to find out how I've worked around bugs in Microsoft tools and frameworks.
|
|
|
|
|
What is the problem??
use
<asp:linkbutton OnClientClick="javascript:yourfunction()" ... >
|
|
|
|
|
Thanks for ur reply. I got the solution
|
|
|
|
|
when u got the solution mark it as answer for him
|
|
|
|
|
i have a master page called master.master
and a page in a folder "MyFolder"
when i'm trying to create a webform page in that folder that inherits the master.master page it doesn't inherit anything and no errors appears
when i put the master page and the webform in the root directory it works !!
what is the problem??
thanks in advance
|
|
|
|
|
You copy the same page, or you create them at those levels ? Anything you create in the designer, uses the folders to create namespaces, perhaps it's a scoping issue ?
Christian Graus
Driven to the arms of OSX by Vista.
Read my blog to find out how I've worked around bugs in Microsoft tools and frameworks.
|
|
|
|
|
|
How do you know that it doesnt inherits anything?
Check the Page header in design view.. of the ContentPage and see if path of
MasterPageFile is proper one
|
|
|
|
|
sure i did see the design
it seems like no style sheet applied to the page but i can see the content placeholders on the page !!!
|
|
|
|
|
Try to use
../
for one folder
or try using delete privacy data in ie explorer
|
|
|
|