473,698 Members | 2,370 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Interactive/Non-interactive ASPX ?

WJ
I have three ASPX pages:

1. "WebForm1.a spx" is interactive, responsible for calling a web site
(https://www.payMe.com) with $$$. It is working fine.
2. "WebForm2.a spx" is non-interactive, a listener in my site to capture a
"STATUS_CD" returned by www.payMe.com. It is working fine.
3. "WebForm3.a spx" is interactive page, responsibe to display the STATUS
CODE "POSTED" by "WebForm2.aspx" .

4. My goal is to use "WebForm2.a spx" to call "WebForm3.a spx" automatically
when it was POSTED by www.payMe.com without user involvement. But it did not
work and there was no error detected/displayed. To get around, in
"WebForm2.aspx" , I had to write the status code to a local text file, then
in "WebForm1.a spx" (still present on the user's Browser while all these
behind-the-scence things are taking place), used a buttonClick event handler
to call "WebForm3.a spx" with the same code as shown below in
"WebForm2.aspx" .

5. My code (c#) for "WebForm2.a spx" (listener page) is shown below:

*************** *************** *************** *************** ******
using several .netClasses;

namespace TestMe
{
public class WebForm2: System.Web.UI.P age //This page is a listener,
therefore, it is not interactive
{
private void Page_Load(objec t sender, System.EventArg s e)
{
if(!IsPostBack)
{
if(Request.Form .Keys.Count==0)
{
//Show Error: Failed on POST status returned from
www.payME.com;
return;
}

string sKey=""; //Name="STATUS_CO DE"
string sVal=""; //Value="OK" or "NOT OK"
string sQ=@""""; //constant used for string concat.

//Step# 1 - Extract one Status code sent by
https://www.payME.com.
//This step always works

sKey=Request.Fo rm.Keys[0].ToString();
sVal=Request[sKey].ToString();

//Step# 2 - Using "POST" method to send status code to
Action="WebForm 3.aspx".
//This did not work, nor error was detected/shown.
//To make it work, comment these lines below and write the
status code to the disk,
//then have "WebForm1.a spx" reads the data from the disk and
call "WebForm3.a spx" to display it.
//Please note: These lines below will always work in
"WebForm1.aspx" .

Response.Clear( );
Response.Write( "<HTML><HEA D></HEAD>");
Response.Write( "<BODY onLoad="Documen t.Form1.submit( )"+sQ+">");
Response.Write( "<FORM NAME="+sQ+"Form 1"+sQ+"
METHOD="+sQ+"Po st"+sQ+" ACTION="+sQ+"We bform3.aspx"+sQ +" >");

//Place KeyName,Value pair here.

Response.Write( "<INPUT NAME="+q+sKey+q +" TYPE="+sQ+"HIDD EN"+sQ+"
VALUE="+q+sVal+ q+">");

//Finish
Response.Write( "</FORM>");
Response.Write( "</BODY></HTML>");
Response.End();
}
}
}
}
*************** *************** *************** *************** ******

Questions:

1. How do I force "WebForm2.a spx" to call "WebForm3.a spx" without having to
write the data to disk and read it back from the disk ?
2. Why the code in "WebForm2.a spx" above works fine in "WebForm1.a spx"
buttonClick Event ? Is it because it is interactive while "WebForm2.a spx" is
not ?

Thanks for your help

John Webbs
Nov 19 '05 #1
2 2000
using several .netClasses;

namespace TestMe
{
public class WebForm2: System.Web.UI.P age //This page is a listener,
therefore, it is not interactive
{
private void Page_Load(objec t sender, System.EventArg s e)
{
if(!IsPostBack)
{
if(Request.Form .Keys.Count==0)
{
//Show Error: Failed on POST status returned from
www.payME.com;
return;
}

Session[sKey]=Request.Form.K eys[0].ToString();
Session[sVal]=Request[sKey].ToString();

Response.Redire ct("page3.aspx" );
}
}
}
}
Then remove keys on page 3. You can also use ViewState, although it is
easier to use with Framework 2.0. In addition, you can set up a queryline.

If you really want to post to another page, set up a JavaScript routine in
the page and call it from body load. That gives you the ability to test the
page properly. No matter what you do, you need to debug the page better.

BTW, your code follows an ASP methodology more than an ASP.NET methodology.
There is really no reason to transfer the person to another page. You can
encapsulate the logic in a class or move it to page 2 and get the same
benefit for the user.

---

Gregory A. Beamer
MVP; MCP: +I, SE, SD, DBA

*************** ************
Think Outside the Box!
*************** ************
"WJ" wrote:
I have three ASPX pages:

1. "WebForm1.a spx" is interactive, responsible for calling a web site
(https://www.payMe.com) with $$$. It is working fine.
2. "WebForm2.a spx" is non-interactive, a listener in my site to capture a
"STATUS_CD" returned by www.payMe.com. It is working fine.
3. "WebForm3.a spx" is interactive page, responsibe to display the STATUS
CODE "POSTED" by "WebForm2.aspx" .

4. My goal is to use "WebForm2.a spx" to call "WebForm3.a spx" automatically
when it was POSTED by www.payMe.com without user involvement. But it did not
work and there was no error detected/displayed. To get around, in
"WebForm2.aspx" , I had to write the status code to a local text file, then
in "WebForm1.a spx" (still present on the user's Browser while all these
behind-the-scence things are taking place), used a buttonClick event handler
to call "WebForm3.a spx" with the same code as shown below in
"WebForm2.aspx" .

5. My code (c#) for "WebForm2.a spx" (listener page) is shown below:

*************** *************** *************** *************** ******
using several .netClasses;

namespace TestMe
{
public class WebForm2: System.Web.UI.P age //This page is a listener,
therefore, it is not interactive
{
private void Page_Load(objec t sender, System.EventArg s e)
{
if(!IsPostBack)
{
if(Request.Form .Keys.Count==0)
{
//Show Error: Failed on POST status returned from
www.payME.com;
return;
}

string sKey=""; //Name="STATUS_CO DE"
string sVal=""; //Value="OK" or "NOT OK"
string sQ=@""""; //constant used for string concat.

//Step# 1 - Extract one Status code sent by
https://www.payME.com.
//This step always works

sKey=Request.Fo rm.Keys[0].ToString();
sVal=Request[sKey].ToString();

//Step# 2 - Using "POST" method to send status code to
Action="WebForm 3.aspx".
//This did not work, nor error was detected/shown.
//To make it work, comment these lines below and write the
status code to the disk,
//then have "WebForm1.a spx" reads the data from the disk and
call "WebForm3.a spx" to display it.
//Please note: These lines below will always work in
"WebForm1.aspx" .

Response.Clear( );
Response.Write( "<HTML><HEA D></HEAD>");
Response.Write( "<BODY onLoad="Documen t.Form1.submit( )"+sQ+">");
Response.Write( "<FORM NAME="+sQ+"Form 1"+sQ+"
METHOD="+sQ+"Po st"+sQ+" ACTION="+sQ+"We bform3.aspx"+sQ +" >");

//Place KeyName,Value pair here.

Response.Write( "<INPUT NAME="+q+sKey+q +" TYPE="+sQ+"HIDD EN"+sQ+"
VALUE="+q+sVal+ q+">");

//Finish
Response.Write( "</FORM>");
Response.Write( "</BODY></HTML>");
Response.End();
}
}
}
}
*************** *************** *************** *************** ******

Questions:

1. How do I force "WebForm2.a spx" to call "WebForm3.a spx" without having to
write the data to disk and read it back from the disk ?
2. Why the code in "WebForm2.a spx" above works fine in "WebForm1.a spx"
buttonClick Event ? Is it because it is interactive while "WebForm2.a spx" is
not ?

Thanks for your help

John Webbs

Nov 19 '05 #2
WJ
Thank you Cowboy for your response,
Session[sKey]=Request.Form.K eys[0].ToString();
Session[sVal]=Request[sKey].ToString();
I found this technique to involve more works than it looks. Reason: I have
to attach a unique session ID or a User Logon ID to each Name,Value pair
because the site supports concurrent sessions (54+ users at the same time).
It sometime colides (data from users mixed up, not happening all the time, I
donot know why)
Response.Redire ct("page3.aspx" );
This instruction does not fire from a listener page. That is why I came here
for help. It only works from an interactive page. The samw holds true to
"Response.Write ()";
Then remove keys on page 3. You can also use ViewState
I do not know this technique well enough to carve it into my current
application. Can you show a sample code.
although it is easier to use with Framework 2.0.
I am still on VS.Net 2003. 2.0 is another two years down the road.
In addition, you can set up a queryline.
Do you mean "Request.QueryS tring" ? If so, I am not allowed to use "GET'.
All activities between pages and sites must use "POST" method.
If you really want to post to another page, set up a JavaScript routine in
the page and call it from body load. That gives you the ability to test
the
page properly. No matter what you do, you need to debug the page better.
I love JS but certain functions I cannot use JS, mostly security and or data
sensitivity issues. The primary goal here is to have the listener page gets
the data from other site, then calls an .aspx page to display the data it
captures. But it does not work.
BTW, your code follows an ASP methodology more than an ASP.NET
methodology. Well, unfortunately it is working reliably, better than session (more work).
For "POST" method, this sure is a clumsy (Response.Write ()) style but it
works with less effort :)
There is really no reason to transfer the person to another page. You can
encapsulate the logic in a class or move it to page 2 and get the same
benefit for the user.


I donot think you get my question right or I failed to explain it clear!
Here is the work flow:

1. My web page call your web page a thousand miles away.
2. Your web page responses to my listener page with a signal (OK or NOT OK)
3. My listener page then alerts my user about the signal received from your
page. This part does not fire up my alert page. As staed earlier, I had to
write the signal to the disk, then have another page to read it and alert
the user.

John
Nov 19 '05 #3

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

5
3746
by: klaus triendl | last post by:
hi, recently i discovered a memory leak in our code; after some investigation i could reduce it to the following problem: return objects of functions are handled as temporary objects, hence their dtor is called immediately and not at the end of the function. to be able to use return objects (to avoid copying) i often assign them to a const reference. now, casting a const return object from a function to a non-const reference to this...
3
12240
by: Mario | last post by:
Hello, I couldn't find a solution to the following problem (tried google and dejanews), maybe I'm using the wrong keywords? Is there a way to open a file (a linux fifo pipe actually) in nonblocking mode in c++? I did something ugly like --- c/c++ mixture --- mkfifo( "testpipe", 777);
25
7623
by: Yves Glodt | last post by:
Hello, if I do this: for row in sqlsth: ________pkcolumns.append(row.strip()) ________etc without a prior:
32
4512
by: Adrian Herscu | last post by:
Hi all, In which circumstances it is appropriate to declare methods as non-virtual? Thanx, Adrian.
8
3503
by: Bern McCarty | last post by:
Is it at all possible to leverage mixed-mode assemblies from AppDomains other than the default AppDomain? Is there any means at all of doing this? Mixed-mode is incredibly convenient, but if I cannot load/unload/reload extensions into my large and slow-to-load application during development without restarting the process then the disadvantages may outweigh the advantages. I've got a mixed-mode program in which I create a new AppDomain...
14
8440
by: Patrick Kowalzick | last post by:
Dear all, I have an existing piece of code with a struct with some PODs. struct A { int x; int y; };
11
3432
by: ypjofficial | last post by:
Hello All, So far I have been reading that in case of a polymorphic class ( having at least one virtual function in it), the virtual function call get resolved at run time and during that the vtable pointer is made use of.. eg. class one {
2
6110
by: Ian825 | last post by:
I need help writing a function for a program that is based upon the various operations of a matrix and I keep getting a "non-aggregate type" error. My guess is that I need to dereference my pointers, but I'm not sure. Please help. The code: void equate(matrix *A, matrix *B) { int i, j; assert(A.row_dim == B.col_dim && A.col_dim == B.col_dim); for(i=0; i < A.row_dim; i++) for(j=0; j < A.col_dim; j++)
0
2340
by: amitvps | last post by:
Secure Socket Layer is very important and useful for any web application but it brings some problems too with itself. Handling navigation between secure and non-secure pages is one of the cumbersome jobs. When a non-secure page references a secure page with relative URL, the web server generates error until absolute URL with https prefix is used. On the other hand when a secure page references a non-secure page, the non-secure page will be...
399
12818
by: =?UTF-8?B?Ik1hcnRpbiB2LiBMw7Z3aXMi?= | last post by:
PEP 1 specifies that PEP authors need to collect feedback from the community. As the author of PEP 3131, I'd like to encourage comments to the PEP included below, either here (comp.lang.python), or to python-3000@python.org In summary, this PEP proposes to allow non-ASCII letters as identifiers in Python. If the PEP is accepted, the following identifiers would also become valid as class, function, or variable names: Löffelstiel,...
0
8603
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 synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
9157
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, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
8861
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 choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
7723
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
1
6518
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 instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
5860
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
4366
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 the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
2
2328
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
3
2001
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 effective websites that not only look great but also perform exceptionally well. In this comprehensive...

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.