Accessing Data generated with client-side script from server-side script 
Author Message
 Accessing Data generated with client-side script from server-side script

But what if I don't want to resubmit the page.  For
example, there is some data on a form that is generated by
a Client Side ( VBScript ) and I want my server-side
Script ot get that data and save it to a file.  I can
generate the Data only on the client-side since it is
dependent on the "document" object, and I can only save
that data to a text file only with a server-side script.
What Do I DO?????

Thanks Alex



Wed, 16 Nov 2005 03:38:48 GMT  
 Accessing Data generated with client-side script from server-side script
Is this a continuation of some other thread?  It seems like it, so I don't
really know the context of this, but I'll tell you now that in a typical
environment, a server cannot access data on a client.  If it could, Web
sites would steal your C:\My credit card numbers and web banking login
information.txt file.

In a private network, it's possible.

Ray at work


Quote:
> But what if I don't want to resubmit the page.  For
> example, there is some data on a form that is generated by
> a Client Side ( VBScript ) and I want my server-side
> Script ot get that data and save it to a file.  I can
> generate the Data only on the client-side since it is
> dependent on the "document" object, and I can only save
> that data to a text file only with a server-side script.
> What Do I DO?????

> Thanks Alex



Wed, 16 Nov 2005 03:43:30 GMT  
 Accessing Data generated with client-side script from server-side script
Let me elaborate on what I'm trying to do.
An .asp page is displaying some order information from a
database, once the page is generated I need to keep a copy
of that page on the server ( I only need the HTML code )
so I can have an html page autmatically generated and
saved for backup purposes for every PO (purchase order)
that we process.  So far I have a button that allows to
get the HTML code from the page and display it into a
textarea box, the problem is that to get the code you need
to use the "document" object, e.g. document.all, which is
accessible from client-side scripts only.  I also created
a script that saves data into a text file, but I can't get
the HTML code from a server-side script, and I don't know
how to get the data the I have already generated.
Is this making any sense to you?

Alex

Quote:
>-----Original Message-----
>Is this a continuation of some other thread?  It seems
like it, so I don't
>really know the context of this, but I'll tell you now
that in a typical
>environment, a server cannot access data on a client.  If
it could, Web
>sites would steal your C:\My credit card numbers and web
banking login
>information.txt file.

>In a private network, it's possible.

>Ray at work



>> But what if I don't want to resubmit the page.  For
>> example, there is some data on a form that is generated
by
>> a Client Side ( VBScript ) and I want my server-side
>> Script ot get that data and save it to a file.  I can
>> generate the Data only on the client-side since it is
>> dependent on the "document" object, and I can only save
>> that data to a text file only with a server-side script.
>> What Do I DO?????

>> Thanks Alex

>.



Wed, 16 Nov 2005 04:01:07 GMT  
 Accessing Data generated with client-side script from server-side script
Yes, I understand.  I guess that's a bit odd since the thing to really keep
is the data, and who cares about what the page looks like, but I guess I can
understand why you'd want that, like if the confirmation page changes or
whatever.  So, basically you're looking to save the response text to a file
on the server, huh?

There is no built in way of getting the response stream into a variable or
anything, like you can't do sVar = Response.Text or anything.  That would be
nice...  You could use the xmlhttp object to load the same page that your
user is seeing and save it that way, but if the page is the result of
method=post, that will complicate things.  Probably the most reliable way to
do it would be to generate the whole page in ASP without intermixing HTML,
like so:

<%

sHTML(0) = "<html><head><title>Confirmation</title></head>"
sHTML(1) = vbCrLf & "<body>Thank you for your order.  Here is your
confirmation info:"
sHTML(2) = vbCrLf & "<table width=""500"" cellpadding=""2""><tr><td>Your
name:</td><td>"
sHTML(3) = sClientName & "</td></tr>"
...etc.etc.

sResult = Join(sHTML)

Set objFSO = Server.CreateObject("Scripting.FileSystemObject")
Set objFile = objFSO.CreateTextFile("C:\SavedOrders\" & iOrderID & ".htm")
objFile.Write sResult
objFile.Close
Set objFSO = Nothing

Response.Write sREsult

%>

untested

Ray at work


Quote:
> Let me elaborate on what I'm trying to do.
> An .asp page is displaying some order information from a
> database, once the page is generated I need to keep a copy
> of that page on the server ( I only need the HTML code )
> so I can have an html page autmatically generated and
> saved for backup purposes for every PO (purchase order)
> that we process.  So far I have a button that allows to
> get the HTML code from the page and display it into a
> textarea box, the problem is that to get the code you need
> to use the "document" object, e.g. document.all, which is
> accessible from client-side scripts only.  I also created
> a script that saves data into a text file, but I can't get
> the HTML code from a server-side script, and I don't know
> how to get the data the I have already generated.
> Is this making any sense to you?

> Alex
> >-----Original Message-----
> >Is this a continuation of some other thread?  It seems
> like it, so I don't
> >really know the context of this, but I'll tell you now
> that in a typical
> >environment, a server cannot access data on a client.  If
> it could, Web
> >sites would steal your C:\My credit card numbers and web
> banking login
> >information.txt file.

> >In a private network, it's possible.

> >Ray at work



> >> But what if I don't want to resubmit the page.  For
> >> example, there is some data on a form that is generated
> by
> >> a Client Side ( VBScript ) and I want my server-side
> >> Script ot get that data and save it to a file.  I can
> >> generate the Data only on the client-side since it is
> >> dependent on the "document" object, and I can only save
> >> that data to a text file only with a server-side script.
> >> What Do I DO?????

> >> Thanks Alex

> >.



Wed, 16 Nov 2005 04:19:01 GMT  
 Accessing Data generated with client-side script from server-side script
Another alternative that I could consider is to have
client-side script that will send the contents of the page
by email automatically without user intervention.  For
example, from a computer that doesn't have an email client
installed.
Any ideas?

Quote:
>-----Original Message-----
>But what if I don't want to resubmit the page.  For
>example, there is some data on a form that is generated
by
>a Client Side ( VBScript ) and I want my server-side
>Script ot get that data and save it to a file.  I can
>generate the Data only on the client-side since it is
>dependent on the "document" object, and I can only save
>that data to a text file only with a server-side script.
>What Do I DO?????

>Thanks Alex
>.



Wed, 16 Nov 2005 05:07:38 GMT  
 Accessing Data generated with client-side script from server-side script
Hi Alex

No, it looks against client's privacy.

Instead, you may want,

x=document.documentElement.innerHtml.

To send the content back to the server, you may want xmlhttp.


Quote:
> Another alternative that I could consider is to have
> client-side script that will send the contents of the page
> by email automatically without user intervention.  For
> example, from a computer that doesn't have an email client
> installed.
> Any ideas?

> >-----Original Message-----
> >But what if I don't want to resubmit the page.  For
> >example, there is some data on a form that is generated
> by
> >a Client Side ( VBScript ) and I want my server-side
> >Script ot get that data and save it to a file.  I can
> >generate the Data only on the client-side since it is
> >dependent on the "document" object, and I can only save
> >that data to a text file only with a server-side script.
> >What Do I DO?????

> >Thanks Alex
> >.



Wed, 16 Nov 2005 07:14:10 GMT  
 
 [ 6 post ] 

 Relevant Pages 

1. ASP referring to server side variables in client side script

2. Client side and Server side script working together

3. Client side scripting / server side scripting

4. Calling Server Side Script from Client Side Script

5. Call Server Side Script From Client Side Script

6. Client side scripting / server side scripting

7. Host (server) side scripting: generating a page using data

8. Client Side + Server Side Scripts

9. Client Side and Server Side Scripts

10. Server Side writing Client Side scripts

11. Passing Server Side Arrays to Client Side Scripts

12. Mixing of client-side and server-side scripts

 

 
Powered by phpBB® Forum Software