WinForm Communicating - Win Form App Could Call Javascript In The Web Browser?
Jul 13, 2009
We have a web app in a web browser running on an intranet so security is less of an issue. We have a separate win form app. Is there any way the Win Form app could call javascript in the web browser. The browser can't be embedded in the WinForm.
Okay sorry to post another simple question but I was browsing through the web trying to learn how to stop a javascript error dialog from appearing on my program and I came across this code on the MSDN website. Me being the idiot, posted the code straight into my code which did not work.
Done quite a bit of looking but not finding what i need. From a win form i'd like to open up a web browser passing in a url. But i need to provide authentication while doing this. I tried just using a system.diagnostics.process.start("http://userid:pw@site") but that does not work. Was hoping someone could lend a hand.
[Code]...
so is there anything else that can be done to get IE to work.. cause i'm thinking that would allow the above code to work as well.
From a win form i'd like to open up a web browser passing in a url. But i need to provide authentication while doing this. I tried just using a system.diagnostics.process.start("http://userid:pw@site") but that does not work. Using the tip.. here is what i have...
Dim m As New System.Security.SecureString Dim pw As String = "mypassword" For Each c As Char In pw
[code]...
I'm getting a logon failure: unknown user name or password.it's seems strange to me.. but if i do in firefox [URL] i can get to my page. If i do the same thing in IE 8... no joy.so is there anything else that can be done to get IE to work.. cause i'm thinking that would allow the above code to work as well.
I have VB.net Simple application with form1.vb , UserControl1.vb and a simple Dataset with few records included. In my UserControl1.vb I'll added a Bound DataGridView1 with Products Datasource. My question is.. How can i filter the Products table from UserControl1.vb? The Filter Value ("ProdID") is from Form1.vb with textbox1(receive the value.). here is my Form1 code
when i go to the address ex http:address with a web browser (e.x. firefox), immediately a popup window appears asking for user name and password. I know both so i enter them.Then firefox allows me to see the web page.Now, in this page there is a javascript button called "Open", (and as i can see from the source code of the page, the button is calling a function called "open()") .
I need to make a web browser that can do all the above automatically and then it "presses" the button "open".
I can make a web browser and then add a button that 1)connects to the adress but how to 2)send the user name and password info and then 3) execute javascript to "press" the "open" button?
How can I call a javascript function from code behind?The most popular response is "ScriptManager.RegisterStartupScript" however, that does not work in my situation. I have a vb class that is doing a database check to see if a record exists. If exists, then call a javascript function to display an alert("Record exists") So I am doing something like
Dim strMessage as string = "javascript:RecordExists('Param');"
Problem is, I need to call a VB.NET function from javascript, no two ways around it. This is a bit harder to find.BTW -- Web/Page methods won't work. I have to be able to reference a listbox and it's selected items when the VB code-behind fires.
I am using textbox(txtFileType) with event OnFocus=("this.blur();"), so I can't use textchanged event for this textbox, I have written a vb code to calculate my FileNumber using Storeprocedures based on the value of textbox(txtFileType). Can I call this vb code from javascript which can be used in clientside.. please help with an example..
i make a program use javascript to call VB.Net function..but it doesn't work...can somebody help me to check this code...Imports System.Runtime.InteropServices
I'm trying to run some java script just before a page redirect but it fails to run. When I comment out the Response.Redirect all works fine but this goes against the particular requirements. how to implement this functionality?
Dim strscript As String = "<script>alert('hello');</script>" If Not ClientScript.IsClientScriptBlockRegistered("clientscript") Then
I have a function that is responsible for populating an SSRS report. The user presses a button and I go out and check to see if there is data. If no data, I provide a NO DATA message. If there is data I call the SSRS report which I would like to open in a new window.
<script type="text/javascript"> function openWindow(url) { document.forms[0].target = "_blank"; } </script>
I have a asp.net web application with jquery controls. I have a datagrid that will display data from a database table and created a WCF Service to access the db and return the data. I want to be able to call the WCF service from this application which is on a different server and have the xml data returned, converted to json format to be used in the datagrid which is a jquery widget. I have tested the web service and it works fine. Should I call the web service from the javascript function within the xml or create a .net method behind that calls the service and then does the conversion? From these how would I get started?
Im struggling to get a web method to work in VB. The javascript gets called but never seems to call the web method. I am running in debug mode and get no errors.
Here is the code:
<System.Web.Services.WebMethod()> Public Shared Sub PasteEvent(EventID As Integer, startDate As DateTime, endDate as DateTime,
[code]....
So far I have :Updated my script manager in the master page to have enablePageMethods="true" Tried adding Imports System.Web.Services Moved the javascript into the body rather than the head
I'm having some issues finding examples of how to use the Awesomium web browser control in vb.net with objectforscripting. I know that objectforscripting isn't the same for the webcontrol used with awesomium since its HTML5 and not the traditional IE control that comes with vs 2010. The issue I'm having is finding any info/examples on how to communicate with the awesomium web browser control with my javascript. It's quite easy with the IE built in control with objectforscripting. I've found samples of how to do it in C# but I don't see any info of how I could do it just in VB. I've searched several things in google and I just can't seem to find anything on how to do it.So for example, I would have a button in a php page that the webcontrol browsers to and if I click the button it closes the application down. So I need to communicate using window.external with the webcontrol in VB.
I have a Javascript function in the js file (test.js) and I need to call her in visual basic 2010 enter her input parameter and load response javascript functions in visual basic.
I have an ASP.NET application with a button that executes VB.NET on the server when clicked. Specs have changed, I've added a menu of sorts which is to replace the VB button. With some from S.O., I've managed to manipulate some javascript which does a postback and executes the button's code. I figured I could just make the button invisible and still be able to call it's on_click event from js. How wrong I was!
So now, somehow I'm supposed to call a VB sub from either javascript or (boss says) ajax. I have no idea how to do this. Could anyone give me a good direction as to how I can call a VB.NET subroutine from ajax on the client? Or javascript?
I have a flash video player embedded in a page which has javascript calls for it's controls, specifically calling playStarted() when the play button is pressed. I want to capture this event asynchronously to record when people are actually playing the video versus visiting the page, but I'm not really sure how to do this.
I was thinking the "hack" of a way would be to create a javascript function called playStarted() that would post the video ID to a separate ASP.NET page that would then record it to SQL (where I store my data on page visits and where I want to store my data on video plays.)
But ideally there is a better way to do this where I can register the javascript to the script manager so it can trigger a public sub asynchronously when it's called