473,574 Members | 2,900 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

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

2 New Member
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.Navi gate line. If I try to run it without the "PostDataSt r" (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 3263
markmcgookin
648 Recognized Expert Contributor
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
mtnbiker
2 New Member
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
45043
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 and format strings from 2 different bound columns. I know I could do this using session variables, but I really want to do it using query string...
2
1993
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 select * from table where id = "query string value" I know it's simple, I just haven't done it for a long time. Can somebody please help me out? ...
3
7442
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 "text/javascript"> function getQueryVariable(variable) { var query = window.location.search.substring(1);
2
1690
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 the query string. i want the solution with the response.redirect method. example : www.mysite.com/member.aspx?id=123&name=coco but i wan the link...
3
7652
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 error below. Can I access a Web Service through a Query Sting. I need to send XML to a Flash movie using a Web Service. Thank You, Jim Lewis ...
4
4002
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 way to remove the parameters from the query sting to prevent undesired activations? Thanks, Keith
3
5748
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 http://myserver.com/application/some.asp?form=y&format=mgs&customerid=893bdgt0248991 I want to be able to redirect to an SSL connection ...
0
1278
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 navigates back to it, even though the query string looks exactly the same in the address bar, the query string results are different. Here's an example...
25
2585
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 2000 characters), and pass to c# page through query string from javascript(ajax). i cant pass the value. what is the solution to do this. thanx in...
0
7815
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main...
0
7738
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language...
1
7833
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 Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For...
0
8118
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the...
1
5635
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes...
0
3756
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in...
0
3770
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
2254
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
0
1081
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating...

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.