Showing posts with label classic. Show all posts
Showing posts with label classic. Show all posts

Thursday, March 29, 2012

pass processing back to asp.dll

This summary is not available. Please click here to view the post.

Pass Recordset from Web Service to Classic ASP.

I want to use the .net Web Service to create a function and return the
datas (RecordSet). And want to retrived those data on the classic ASP.
Does any body have some example of this. How to create the Recordset in
webservice and get it at classic asp.
Thanks and Regards.Ted Ngo wrote:
> I want to use the .net Web Service to create a function and return the
> datas (RecordSet). And want to retrived those data on the classic ASP.
> Does any body have some example of this. How to create the Recordset
> in webservice and get it at classic asp.
> Thanks and Regards.
See this thread:
http://groups.google.com/group/micr...29ded2e3b036cec
Bob Barrows
--
Microsoft MVP -- ASP/ASP.NET
Please reply to the newsgroup. The email account listed in my From
header is my spam trap, so I don't check it very often. You will get a
quicker response by posting to the newsgroup.
so I using this
Or, you can send the XML of the ADO recordset back, and re-construct it
on
the client. Use Interop on the server to work with the ADO recordset.
// ON THE SERVER -- Web Service
// Add references to ADODB library
// Create a stream object
myStream = new ADODB.Stream();
// Replace the constants with their actual values
recordSet.Save(myStream, adPersistXML);
output = myStream.ReadText(adReadAll);
// Return the XML string, complete with schema
return output;
To return the recorset
and then on the asp using this to get the record set
Public Function RecordsetFromXMLString(sXML As String) As Recordset
Dim oStream As ADODB.Stream
Set oStream = New ADODB.Stream
oStream.Open
oStream.WriteText sXML 'Give the XML string to the ADO Stream
oStream.Position = 0 'Set the stream position to the start
Dim oRecordset As ADODB.Recordset
Set oRecordset = New ADODB.Recordset
oRecordset.Open oStream 'Open a recordset from the stream
oStream.Close
Set oStream = Nothing
Set RecordsetFromXMLString = oRecordset 'Return the recordset
Set oRecordset = Nothing
End Function
Is that righ?
Thanks
Yes, that's what I had in mind. Also, see Adam's last message in that
thread.
Bob
Ted Ngo wrote:
> so I using this
> Or, you can send the XML of the ADO recordset back, and re-construct
> it on
> the client. Use Interop on the server to work with the ADO recordset.
>
> // ON THE SERVER -- Web Service
> // Add references to ADODB library
>
> // Create a stream object
> myStream = new ADODB.Stream();
>
> // Replace the constants with their actual values
> recordSet.Save(myStream, adPersistXML);
> output = myStream.ReadText(adReadAll);
>
> // Return the XML string, complete with schema
> return output;
> To return the recorset
> and then on the asp using this to get the record set
> Public Function RecordsetFromXMLString(sXML As String) As Recordset
> Dim oStream As ADODB.Stream
> Set oStream = New ADODB.Stream
> oStream.Open
> oStream.WriteText sXML 'Give the XML string to the ADO Stream
> oStream.Position = 0 'Set the stream position to the start
> Dim oRecordset As ADODB.Recordset
> Set oRecordset = New ADODB.Recordset
> oRecordset.Open oStream 'Open a recordset from the stream
> oStream.Close
> Set oStream = Nothing
> Set RecordsetFromXMLString = oRecordset 'Return the recordset
> Set oRecordset = Nothing
> End Function
> Is that righ?
> Thanks
Microsoft MVP -- ASP/ASP.NET
Please reply to the newsgroup. The email account listed in my From
header is my spam trap, so I don't check it very often. You will get a
quicker response by posting to the newsgroup.

Friday, March 16, 2012

Passing a variable

Hi Everyone,

Still new to ASP Web development my question is: How do you pass a variable from a .Net Aspx page to a classic ASP page?

The simplest method will be using the QueryString object.

aspx

Response.Redirect("asp.asp?var1=hello")

asp

Response.write(request.querystring("var1"))

Regards

passing a variable to new page

Hello
I am new to asp.net, please help.
I have link and this works fine
Add/Edit

In classic asp I would use

<% Request.form("tbName ") %>

or
<% Request("tbName") %>

Sometimes I would assign this value to a variable and use it anywhere on the page.
How do I do this or is there a better way to do it in .net.
TIA MichaelIn the adim_sCodeEdit.aspx file, you just do the same:

(In the code behind file)

Dim tbName as string = request.params("tbName")

...
And do the test, make sure you capture the right result:

 response.write(tbName)

Thanks for the quick reply le9569
My companies isp does not support code behind.
This is how I have it now and it works. I was not sure where to put the
 response.write(tbName)
to make it work, everyplace I tried gave me errors.
Thanks again


<%@. Page Language="vb" Debug="true" %>
<script runat="server">
Sub Page_Load(Source as Object, E as EventArgs)
Dim tbName as string = request.params("tbName")
lbltbName.text = tbName
End Sub

</script>
<html>
<head>
</head>
<body>
<form runat="server">
<asp:Label id="lbltbName" runat="server"></asp:Label>
</form>
</body>
</html>