How to open XML file in a new Browser Window in VB.NET?

I have a page which opens the diffredt uploaded docs(.doc,.xls,.xml,.csv etc) from Server.

Now i want to open this docs from my application.. . i can open .doc, .xlx, .jpg etc. .. but i cant open .xml.
How do i open the .xml file from m y application.

right now i use  Shell("file:\\../shared/" & strpath & "/" & CStr(docname) & ext)

but it gives me an error  "file not found", but fiel is there in same folder.

Regards
Nitesha
RedshelfAsked:
Who is Participating?

[Product update] Infrastructure Analysis Tool is now available with Business Accounts.Learn More

x
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

Alfred A.Commented:
Hi,

You can use a Web Browser Control and then use WebBrowser1.Navigate method to open the XML file.
0
Alfred A.Commented:
Just additional comment from my previous post, you can use Navigate method to use a physical path something like

WebBrowser1.Navigate("WebBrowser1.Navigate("C:\YourFile.xml"))
0
RedshelfAuthor Commented:
how do i add Web Browser control in my projetc. I have added Microsoft Web Browser COM component from tools ..but i can not see it in my tool box. where i  can find it?
0
Learn Ruby Fundamentals

This course will introduce you to Ruby, as well as teach you about classes, methods, variables, data structures, loops, enumerable methods, and finishing touches.

Alfred A.Commented:
What is the version of Visual Studio you are using VS2005 or VS2008?
0
RedshelfAuthor Commented:
VS2008
0
Alfred A.Commented:
OK.  Under "All Windows Forms" tab, the last control in there should be "WebBrowser"
0
RedshelfAuthor Commented:
i cant find "All Windows Forms.

I ahve only, Standart,data,validation,navigation,login.webparts,AJAX extensions,reporting, html and general in my tool box.

where i can find "All Windows Forms"  tab ?
0
RedshelfAuthor Commented:
Is there any way i can create and use it  using  code behind..?
0
Alfred A.Commented:
Can you please clarify?  Are you doing an ASP.NET (Web application) Project or VB.NET (Windows Application) project?
0
Alfred A.Commented:
If you are using ASP.NET, check this out.  It can help.

http://support.microsoft.com/kb/315906
0
RedshelfAuthor Commented:
I have  managed to open XML file into new window using following code on button click.

 str = "<script type='text/javascript'>detailedresults=window.open('" & "../shared/" & strpath & "/test.xml" & "'" & "," & docname & " );</script>"
 ClientScript.RegisterStartupScript(Me.GetType(), "AvisoScript", str)

but i have a another problem now..
if strpath is like "\cat1\cat2" then it removes  back slash ( \ ) from the path. so it tries to open cat1cat2/test.xml. so i receive the error File not found.
 it should be cat/cat2/test.xml.  

Do you ahve any idea why it remove \ from strpath strin varible which stores the part of the path .

i have .aspx page and .aspx.vb page for my code behind.

Nitesha
0
Alfred A.Commented:
OK.  Use Server.MapPath to get the actual path for example.

Dim path As String = Server.MapPath("Images/blueWave.JPG")
Dim path As String = Server.MapPath("../Images/blueWave.JPG")
Dim path As String = Server.MapPath("~/Images/blueWave.JPG")

0
Alfred A.Commented:
Here is more information about Server.MapPath

http://msdn.microsoft.com/en-us/library/ms524632%28VS.90%29.aspx
0
RedshelfAuthor Commented:
thansk
0
RedshelfAuthor Commented:
Solved ...there was some extra / in the path ..so thats whya it was not opening the doc. but learn a lot from this thread.

Nitesha
0

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
ASP.NET

From novice to tech pro — start learning today.