|
-
Jul 26th, 2005, 05:57 AM
#1
Thread Starter
New Member
Opening an HTML page with button click
Hello
I want to display information in my database, not in a datagrid or other control, but in an HTML page.
What is the easiest way of achieving this?
Thanks
-
Jul 26th, 2005, 08:27 AM
#2
Addicted Member
Re: Opening an HTML page with button click
Depends what the information you are trying to display is. Normally, if you want information from your DB, you would write an ASP/ASP.NET page to access the relevant information and display it.
You would then place a web browser control on a form and use the navigate method to go to the page you created.
HTH
Look into the heart of infinity and find your truth
Colonel Tom Edwards: This is the most fantastic story I've ever heard
Jeff Trent: And every word of it's true, too
Colonel Tom Edwards: That's the fantastic part of it
ROFL 
-
Jul 26th, 2005, 11:20 PM
#3
New Member
Re: Opening an HTML page with button click
Dim oProcess As Process
oProcess.Start("http://www.vbforums.com")
-
Jul 26th, 2005, 11:47 PM
#4
Re: Opening an HTML page with button click
You could just use the streamwriter to create a html file from the data from your db. Then use the process object to start it in a browser.
VB/Office Guru™ (AKA: Gangsta Yoda™ ®)
I dont answer coding questions via PM. Please post a thread in the appropriate forum. 
Microsoft MVP 2006-2011
Office Development FAQ (C#, VB.NET, VB 6, VBA)
Senior Jedi Software Engineer MCP (VB 6 & .NET), BSEE, CET
If a post has helped you then Please Rate it! 
• Reps & Rating Posts • VS.NET on Vista • Multiple .NET Framework Versions • Office Primary Interop Assemblies • VB/Office Guru™ Word SpellChecker™.NET • VB/Office Guru™ Word SpellChecker™ VB6 • VB.NET Attributes Ex. • Outlook Global Address List • API Viewer utility • .NET API Viewer Utility •
System: Intel i7 6850K, Geforce GTX1060, Samsung M.2 1 TB & SATA 500 GB, 32 GBs DDR4 3300 Quad Channel RAM, 2 Viewsonic 24" LCDs, Windows 10, Office 2016, VS 2019, VB6 SP6 
-
Jul 27th, 2005, 04:19 AM
#5
Re: Opening an HTML page with button click
Drop winforms and move to webforms instead.
-
Aug 17th, 2006, 09:17 AM
#6
Junior Member
Re: Opening an HTML page with button click
 Originally Posted by RobDog888
You could just use the streamwriter to create a html file from the data from your db. Then use the process object to start it in a browser.
Hello RobDog, this is exactly what I need to do...but HOW? I have a HTML file in a IsolatedStorage and want to show it in the browser. Which method would be suitable?
Thank you a lot.
Ravie.
-
Aug 17th, 2006, 12:46 PM
#7
Re: Opening an HTML page with button click
VB Code:
Dim oProcess As Process
oProcess.Start("C:\MyFile.htm")
VB/Office Guru™ (AKA: Gangsta Yoda™ ®)
I dont answer coding questions via PM. Please post a thread in the appropriate forum. 
Microsoft MVP 2006-2011
Office Development FAQ (C#, VB.NET, VB 6, VBA)
Senior Jedi Software Engineer MCP (VB 6 & .NET), BSEE, CET
If a post has helped you then Please Rate it! 
• Reps & Rating Posts • VS.NET on Vista • Multiple .NET Framework Versions • Office Primary Interop Assemblies • VB/Office Guru™ Word SpellChecker™.NET • VB/Office Guru™ Word SpellChecker™ VB6 • VB.NET Attributes Ex. • Outlook Global Address List • API Viewer utility • .NET API Viewer Utility •
System: Intel i7 6850K, Geforce GTX1060, Samsung M.2 1 TB & SATA 500 GB, 32 GBs DDR4 3300 Quad Channel RAM, 2 Viewsonic 24" LCDs, Windows 10, Office 2016, VS 2019, VB6 SP6 
-
Aug 21st, 2006, 12:47 AM
#8
Junior Member
Re: Opening an HTML page with button click
 Originally Posted by RobDog888
VB Code:
Dim oProcess As Process
oProcess.Start("C:\MyFile.htm")

Thank you, RobDog. Unfortunately, I do not know the file's path, because it is stored in Isolated storage mode:
Dim writer as new StreamWriter (New IsolatedStorageFileStream("ia.htm", FileMode.Create, isostore))
writer.writeline....
writer.close()
Is there a way around this?
Thank you very much.
Ravie
-
Aug 21st, 2006, 01:09 AM
#9
Re: Opening an HTML page with button click
You could use a browser control in your own app rather than spawning an external process. If you have the HTML code in a string then you can assign it to the DocumentText property of the WebBrowser control. If you're using .NET 1.x (please specify in future) then I'd imagine that the ActiveX Web browser would have something similar.
-
Aug 21st, 2006, 01:17 AM
#10
Junior Member
Re: Opening an HTML page with button click
Hello jmcilhinney,
I'm using .NET 1.x, but as I am not very experienced in VS.2003, I'd need something simple, if possible, or an example . I just realised that even the RobDog's solution is not suitable for this, because I am developing a Sharepoint WEb Part and even when using oprocess.Start("C:\file.htm") I get a web part error, damn it :-/.
I fear I'll have to learn how to debug web parts :-)
Thank you very much.
Ravie
-
Aug 21st, 2006, 01:50 AM
#11
Re: Opening an HTML page with button click
I have no idea how Web Parts work. Having read your first post again I realise that my suggestion violates your "other control" condition anyway.
-
Aug 21st, 2006, 10:25 AM
#12
Re: Opening an HTML page with button click
Allow me to gracefully repeat myself: Use webforms. In other words, use ASP.NET. Unless that is what you are already using in which case you should have mentioned this earlier.
I am guessing that you are already using ASP.NET, because you've mentioned SPS Webparts, and are looking to display some information from a database. You have many options to do so, you only need to read up on some ADO.NET and you can use gridviews/datagrids to display the information.
-
Aug 22nd, 2006, 12:36 AM
#13
Junior Member
Re: Opening an HTML page with button click
 Originally Posted by mendhak
Allow me to gracefully repeat myself: Use webforms. In other words, use ASP.NET. Unless that is what you are already using in which case you should have mentioned this earlier.
I am guessing that you are already using ASP.NET, because you've mentioned SPS Webparts, and are looking to display some information from a database. You have many options to do so, you only need to read up on some ADO.NET and you can use gridviews/datagrids to display the information.
Hello Mendhak,
I don't need to use datagrids and stuff like that, because I have to print a formatted output. This is why I use HTML. Other option would be to use MS Word - but I am not sure whether Word can be forced to import html code via VS.NET.
Thank you.
Ravie.
-
Aug 22nd, 2006, 07:43 AM
#14
Re: Opening an HTML page with button click
How is Webparts related to this then? You say you're getting a web parts error, explain that again in more detail.
-
Aug 22nd, 2006, 08:19 AM
#15
Junior Member
Re: Opening an HTML page with button click
 Originally Posted by mendhak
How is Webparts related to this then? You say you're getting a web parts error, explain that again in more detail.
I am getting the data from the DB into a Web part. The Web parts are difficult to debug, so I am working via "build-display web part-edit code-build-display...", so the Web Part either works correctly or throws an unspecified error.
I need to open an HTML code, which I have in a web part String variable, in a new browser window - that's all, but it doesn't seem to be simple at the moment
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|