|
can anyone of you direct me to a tutorial to do this.
thanks
|
|
|
|
|
:|How to use asp:radio button control in datagrid without any postback and
whenever I check first radio button in first row of grid, none other should be checked. If second RDB in second row of grid is checked, first should be unchecked.
can somebody suggest for this code?........Please
Balasaheb
|
|
|
|
|
Hi All,
I am unable to display an image in mozilla, when i give the path as "drive:/folder1/abc.jpg". any solution plz?
I tried both:
src="file:///D:/sweets/MHCPNWWebApp/Images/prod_img04.jpg" and also src="D:/sweets/MHCPNWWebApp/Images/prod_img04.jpg"
In both the case the image is not displayed in Mozilla or Firefox..
But when the image path is directly typed in browser image gets displayed..
need help please...
|
|
|
|
|
The image is only displayed when you view the web page in the browser using the file:///...
|
|
|
|
|
I have tried both the options..If i giv ethe image path as
file:///d/:foldername/abc.jpgthe image itsel is not shown...
also the path is not read..
can u give me any other option..coz it works good in IE
but image fails to get display only in Mozilla and Netscape.
|
|
|
|
|
By this mean, if you use the file:/// protocol for the images in the web page, then the web page also needs to be viewed with this protocol in FF (though IE works just fine in this case). If you view the web page starting with http:// .. then the url of the images need to be set with http.
|
|
|
|
|
Hello everyone:
I am struggling with XML (which I am really not good at), the file that I am working with is something like this:
<MotherCompany Name="MC">
<Company Name="CompanyOne">
<Department>
<IsPositions>
<Temp>
<MoreNestedDetails></MoreNestedDetails>
</Temp>
<IsPerm>
<MoreNestedDetails></MoreNestedDetails>
</IsPerm>
<Intern>
<MoreNestedDetails></MoreNestedDetails>
</Intern>
<Other>
<MoreNestedDetails></MoreNestedDetails>
</Other>
</IsPositions>
</Department>
</CompanyOne>
<Company Name="CompanyTwo">
<Department>
<IsPositions>
<Temp>
<MoreNestedDetails></MoreNestedDetails>
</Temp>
<IsPerm>
<MoreNestedDetails></MoreNestedDetails>
</IsPerm>
<Intern>
<MoreNestedDetails></MoreNestedDetails>
</Intern>
<Other>
<MoreNestedDetails></MoreNestedDetails>
</Other>
</IsPositions>
</Department>
</CompanyTwo>
<Company Name="CompanyThree">
<Department>
<IsPositions>
<Temp>
<MoreNestedDetails></MoreNestedDetails>
</Temp>
<IsPerm>
<MoreNestedDetails></MoreNestedDetails>
</IsPerm>
<Intern>
<MoreNestedDetails></MoreNestedDetails>
</Intern>
<Other>
<MoreNestedDetails></MoreNestedDetails>
</Other>
</IsPositions>
</Department>
</CompanyThree>
<Company Name="CompanyFour">
<Department>
<IsPositions>
<Temp>
<MoreNestedDetails></MoreNestedDetails>
</Temp>
<IsPerm>
<MoreNestedDetails></MoreNestedDetails>
</IsPerm>
<Intern>
<MoreNestedDetails></MoreNestedDetails>
</Intern>
<Other>
<MoreNestedDetails></MoreNestedDetails>
</Other>
</IsPositions>
</Department>
</CompanyFour>
</MotherCompany>
Now what I need to do is read the information for each Company under MotherCompany.
A - Since its so freaking nested I am confused as to how to go about collecting the information. Any ideas and suggestion?
B - I tried to use XMLReader; I was doing something like:
<br />
XmlTextReader reader = new XmlTextReader(FileNameWithPath); <br />
while (reader.Read())<br />
{<br />
if (reader.Name == "Company")<br />
{<br />
if (reader.NodeType == XmlNodeType.Element)<br />
{<br />
XmlReader currentNode = reader.ReadSubtree();<br />
while (currentNode.Read())<br />
{<br />
if (currentNode.NodeType == XmlNodeType.Element)<br />
{<br />
switch (currentNode.Name)<br />
{<br />
case "Temp<br />
dataCol.MethodList.Add(currentNode.Name);<br />
break;<br />
case "IsPerm<br />
dataCol.MethodList.Add(currentNode.Name);<br />
break;<br />
case "Intern<br />
dataCol.MethodList.Add(currentNode.Name);<br />
break;<br />
case "Other<br />
dataCol.MethodList.Add(currentNode.Name);<br />
break;<br />
default:<br />
break;<br />
}<br />
}<br />
}<br />
}<br />
}<br />
}<br />
First of all my reader.ReadSubtree(); reads all the Company Elements, I thought that it would read any thing within the Company Element so I would be able to get data for seperate Company Elements depending on thier the Name attribute. How can I do that in the given scenario? Is there a better way? Like somehow skip to the elements that I need instead of worrying about the nested loops and crap?
Any help will be great and HIGHLY appreciated. Thanks.
PS: At some point I will need to go and get more details and it looks like I am keep nesting while loops for every detailed value; is there a better way of doing that?
|
|
|
|
|
Use XPathDocument or XmlDocument instead of the XmlTextReader, unless this is a really huge file.
XPathDocument doc = new XPathDocument("MyFile.xml");<br />
XPathNavigator nav = doc.CreateNavigator();<br />
<br />
XPathNodeIterator nodes = nav.Select("//Company");
Now you should have a collection of Company nodes to iterate through
only two letters away from being an asset
|
|
|
|
|
Mark:
Thanks a lot for your suggestion. This document is typically more then 500 lines but the Company Nodes are not the one that increase the file size, its other junk thats embeded in it. Do you think it would be ok to use XPathDocument for such size files?
Thanks.
|
|
|
|
|
It should be fine as long as the file size isn't more than say 1mb
only two letters away from being an asset
|
|
|
|
|
Well just came to find out that the file I've been working with is not an xml file instead it is an xsd file
This will explain why xmlreader was working by xpath logic was not working (yeah it was looping thorugh all the elements ).
Any suggestions?
|
|
|
|
|
XPathDocument doc = new XPathDocument(FileNameWithPath);
XPathNavigator nav = doc.CreateNavigator();
XPathNodeIterator nodes = nav.Select("/MotherCompany/Compant/Department/IsPositions");
XPathNavigator nodesNav = nodes.Current;
XPathNodeIterator ni = nodesNav.SelectDescendants(XPathNodeType.Element, false);
while(nodes.MoveNext())
{
MessageBox.Show(nodes.Current.Name);
richTextBox1.AppendText(Environment.NewLine
+ "Name:" + Environment.NewLine
+ nodes.Current.Name + Environment.NewLine +
nodes.Current.Value
);
}
When I look in the debug mode to see what is going; this is what I get for my ni Position=0, Current={Root}, Count=0
And aparently nothing happends...
Can someone please help me read this document? I sure would appreciate it. Thanks.
Regards,Robert
|
|
|
|
|
XPathNodeIterator nodes = nav.Select("/MotherCompany/Compant/Department/IsPositions");
nodes.MoveNext();
XPathNavigator nodesNav = nodes.Current;
The iterator is not positioned at the start so you must move to an element before accessing anything.
only two letters away from being an asset
|
|
|
|
|
Thanks for your help and patience with me Mark. However I still dont get any thing even after putting nodes.MoveNext().
Do you think that <xs:schema>, <xs:annotation>, <xs:appinfo> (which are at the top of the document and <MotherCompany> is nested within <xs:appinfo> ) has anything to do with it?
Appreciate your help.
Regards,
Robert
|
|
|
|
|
The XmlReader probably isn't the way to go here. Load your xml into an XmlDocument and use the SelectNodes method to select the specific nodes you want, for example you could do something like this:
XmlNodeList tempPositions = myXml.SelectNodes("/Company/Department/Temp");<br />
foreach(XmlNode position in tempPositions)<br />
tempPositions.Add(position.Name);
The best thing you could do is get familiar with XPath queries and use them to extract the specific information you need from your XmlDocument.
|
|
|
|
|
plz, i need some application for educational perpose .
plz, help me .
jignesh patel
|
|
|
|
|
static void Main(string[] args)
{
Console.WriteLine("Hello, world");
}
only two letters away from being an asset
|
|
|
|
|
Best Regards,
Apurva Kaushal
|
|
|
|
|
How can I run a flash file inside an asp .net page?
|
|
|
|
|
|
plz send some .net projects using asp.net,c#,sqlserver2000
|
|
|
|
|
Why? Where to?
---
b { font-weight: normal; }
|
|
|
|
|
r u an student or an Developer. first of all go through the "Chris" first question.
And then post ur questions.
With Regards
Satips
|
|
|
|
|
i have pag to regestration this page contain alot of textbox i want to delet the value in text boxses after end regestration
thank you for help me
ashrafhakiem
|
|
|
|
|
HI,
First say your are cerating an Windows based or Web based form??? and the platform you use
Know is Drop, Unknown is Ocean
|
|
|
|