Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations IamaSherpa on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Calling ASP .NET page from VFP: 3

Status
Not open for further replies.

hunterspot

Programmer
Jun 3, 2009
22
US
Hi
Will any one of you please show me how to call an ASP .NET page from a VFP app? It is like replacing an existing VFP form with an ASP .NET page. If we can call, can we control the behaviour, like sizing the screen, opening the web page in a container or ole object, not allowing the user to minimize the web page and work on the VFP form? One final question, can the web page return some value to the calling VFP method?
I would greatly appreciate if someone can post a sample code.

Thanks for your time
 
You can use Shell.Explorer control (or Web browser control from FFC) to display an asp page. You can set/get values from web page in most cases but not all. An ASP page might be hosting objects that you cannot interfere with such as a silverlight control. For a sample check:


Cetin Basoz
MS Foxpro MVP, MCP
 
You can use the webbrowser control, put it on a vfp form, anchor it and you'll have a webapp page embedded in a vfp form. You can mix with VFP controls outside of the webbrowser control of course. Interaction with the HTML DOM is possible but not with silverlight or flash objects embedded in the html, like Cetin said.

Just put NODEFALT in the Refresh even of the webbrowser conrol, then in init call THIS.Navigate2(" and you call an ASP.NET page

Or call Navigate2(" to pass parameters via URL to the ASP.NET page.

Bye, Olaf.
 
sample:

PUBLIC oForm
oForm=NEWOBJECT("form1")
oForm.show

DEFINE CLASS form1 AS form


DoCreate = .T.
Caption = "Form1"
Name = "Form1"


ADD OBJECT oweb AS olecontrol WITH ;
Top = 0, ;
Left = 0, ;
Height = 250, ;
Width = 375, ;
Anchor = 15, ;
Name = "oWeb",;
OleClass="Shell.Explorer.2"


PROCEDURE Init
this.oWeb.navigate(" ENDPROC


PROCEDURE oweb.BeforeNavigate2
LPARAMETERS pdisp, url, flags, targetframename, postdata, headers, cancel
MESSAGEBOX(url)
cancel=.t.
ENDPROC


ENDDEFINE
*
*-- EndDefine: form1
**************************************************
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top