473,396 Members | 1,858 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,396 software developers and data experts.

Using Webbrowser to load a page from a file with a query string?

Am a novice at this. Trying to write a piece of code for personal use. Intent is to load a web page from a file (.html) and pass to it three parameters using a query string. Code is written in Visual C# with .net CF 3.5. Target platform is Windows Mobile. Using Windows Mobile 6 SDK. Example code is below passing only one parameter:

Expand|Select|Wrap|Line Numbers
  1.         private void RefreshData()
  2.         {
  3.             string temp_url="file://\\Program Files\\Test\\Test.html";
  4.             string PostDataStr = "?Type=NewType";
  5.  
  6.             temp_url = temp_url + PostDataStr;
  7.  
  8.             Uri address = new Uri(temp_url);
  9.             webBrowser.Navigate(address);
  10.         }
  11.  
When I try to run this on the emulator, it gives an unhandeld exception at the webBrowser.Navigate line. If I try to run it without the "PostDataStr" (no query string) it loads fine. Have spent hours searching for the correct way to do this, to no avail. What is the best method for doing this? If this has been answered elsewhere, I apologize in advance and please direct me to the appropriate post.
Mar 15 '10 #1
2 3257
markmcgookin
648 Expert 512MB
Well you are trying to execute some form of back end code on the file. This can only be achieved with server side processing... and unless you are going to run a web server on the PDA... that ain't gonna work locally.

If the site was running on a web server with a valid URL that you could visit on a desktop machine and pass that argument on this might work but not a local static html file.... for a start you can't do any processing in html.. it's just markup.
Mar 15 '10 #2
Thanks for the quick reply. Obviously, I do not do this for a living! Good thing. That being said, is there a managed code (Visual C#) way to load a local .html file into a web browser-type form and pass certain parameters to the file (the file is java script and the parameters are values I am reading out of the registry). Seems to me, there should be some way of doing this, although the way I have shown is obviously not the correct one...
Mar 16 '10 #3

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

Similar topics

3
by: bpschmid | last post by:
Ive got a datagrid with a hyperlink column. I want to click on that column and go to another page, but here's the kicker, I need and want to pass not one, but two different query string parameters...
2
by: Andy | last post by:
I haven't done any web work for over a year and for the life of me I cannot remember how to use a query string in a URL. I want the link to be page.aspx?ID=1 then pass 1 into a query like this ...
3
by: Dr. Oz | last post by:
Hi, I am trying to read in a query string from one page and build a link to another page based on the query string. Here's the code I am using to read in the query string: <script...
2
by: bhavik | last post by:
hi i want to know how to hide the values in query string in ASP.net. here i want to send the values from one page to another page through query string with out explicitly visible the values in...
3
by: Jim Lewis | last post by:
I have read several things that state accessing a Web Service through a Query String should work. However, when I try to execute http://localhost/webservice1/service1.asmx/HelloWorld I get the...
4
by: keithb | last post by:
A page uses query string values to add a record to a database. The record should be added only once; however, if a user activates the url additional times, multiple records are added. Is there some...
3
by: Nuevo | last post by:
I am looking for some method to capture, into a variable, the entire URL of an http request and redirect to SSL. For example, if a user opens a browser and typed in ...
0
by: =?Utf-8?B?SnVsaWEgQg==?= | last post by:
Hi all, I've got a search result web page that is populated dependant on data in the query string. It works fine. However if the user navigates away from the search results page, then...
25
nirmalsingh
by: nirmalsingh | last post by:
hai all, i am using, ajax and c#.net. my problem is, i want to store a huge data in database using(c#), which is done in behind the screen. when i get data from a html textarea(more than...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
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
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
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...

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.