473,320 Members | 1,580 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,320 software developers and data experts.

I am getting a little further, but still having issues...

If you need more information, I'd be glad to give it, but I am
developing an ASPX page so that the user can select multiple values for
a specific field, then pass them on (using Crystal Reports 10 on a
separate ASP page). Here is the code behind the button that will
launch the report (is in a file called StateSelect.aspx.vb:

Protected Sub Button2_Click(ByVal sender As Object, ByVal e As
System.EventArgs) Handles Button2.Click
Server.Transfer("/NewCrystalReports/genericreport.asp", True)
End Sub
When I launch the ASP page and hit the submit button, I get the
following error in the IE window:

Server Error in '/NEWCrystalReports' Application.
--------------------------------------------------------------------------------

Error executing child request for /NewCrystalReports/genericreport.asp.

Description: An unhandled exception occurred during the execution of
the current web request. Please review the stack trace for more
information about the error and where it originated in the code.

Exception Details: System.Web.HttpException: Error executing child
request for /NewCrystalReports/genericreport.asp.

Source Error:
Line 40:
Line 41: Protected Sub Button2_Click(ByVal sender As Object, ByVal
e As System.EventArgs) Handles Button2.Click
Line 42:
Server.Transfer("/NewCrystalReports/genericreport.asp", True)
Line 43: End Sub
Line 44: End Class
Source File: c:\inetpub\wwwroot\NEWCrystalReports\StateSelect.a spx.vb
Line: 42

Stack Trace:
[HttpException (0x80004005): Error executing child request for
/NewCrystalReports/genericreport.asp.]
System.Web.HttpServerUtility.ExecuteInternal(IHttp Handler handler,
TextWriter writer, Boolean preserveForm, String path, String filePath,
String physPath, Exception error, String queryStringOverride) +3137343
System.Web.HttpServerUtility.Execute(String path, TextWriter writer,
Boolean preserveForm) +722
System.Web.HttpServerUtility.Transfer(String path, Boolean
preserveForm) +55
_Default.Button2_Click(Object sender, EventArgs e) in
c:\inetpub\wwwroot\NEWCrystalReports\StateSelect.a spx.vb:42
System.Web.UI.WebControls.Button.OnClick(EventArgs e) +105
System.Web.UI.WebControls.Button.RaisePostBackEven t(String
eventArgument) +78

System.Web.UI.WebControls.Button.System.Web.UI.IPo stBackEventHandler.RaisePostBackEvent(String
eventArgument) +7
System.Web.UI.Page.RaisePostBackEvent(IPostBackEve ntHandler
sourceControl, String eventArgument) +11
System.Web.UI.Page.RaisePostBackEvent(NameValueCol lection postData)
+33
System.Web.UI.Page.ProcessRequestMain(Boolean
includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint)
+5670


--------------------------------------------------------------------------------
Version Information: Microsoft .NET Framework Version:2.0.50215.44;
ASP.NET Version:2.0.50215.44

There is this line in the ASPX file itself:

<form method="post" id="form1" runat="server"
action="GenericReport.asp">

The server is running ASP.NET v2 (Windows 2003 Server with IIS 6) and I
am developing in VS .NET 2005.

Nov 19 '05 #1
8 1782
Brent,

I'm pretty certain that you can't server.transfer from a new ASP.NET
application back to an old ASP application. Server.Transfer will try to make
your ASP.NET application load the .asp page into it's runtime. That of
course can't happen since the code is foreign to it.

--
Sincerely,

S. Justin Gengo, MCP
Web Developer / Programmer

www.aboutfortunate.com

"Out of chaos comes order."
Nietzsche
"Brent White" <bw****@badgersportswear.com> wrote in message
news:11**********************@g14g2000cwa.googlegr oups.com...
If you need more information, I'd be glad to give it, but I am
developing an ASPX page so that the user can select multiple values for
a specific field, then pass them on (using Crystal Reports 10 on a
separate ASP page). Here is the code behind the button that will
launch the report (is in a file called StateSelect.aspx.vb:

Protected Sub Button2_Click(ByVal sender As Object, ByVal e As
System.EventArgs) Handles Button2.Click
Server.Transfer("/NewCrystalReports/genericreport.asp", True)
End Sub
When I launch the ASP page and hit the submit button, I get the
following error in the IE window:

Server Error in '/NEWCrystalReports' Application.
--------------------------------------------------------------------------------

Error executing child request for /NewCrystalReports/genericreport.asp.

Description: An unhandled exception occurred during the execution of
the current web request. Please review the stack trace for more
information about the error and where it originated in the code.

Exception Details: System.Web.HttpException: Error executing child
request for /NewCrystalReports/genericreport.asp.

Source Error:
Line 40:
Line 41: Protected Sub Button2_Click(ByVal sender As Object, ByVal
e As System.EventArgs) Handles Button2.Click
Line 42:
Server.Transfer("/NewCrystalReports/genericreport.asp", True)
Line 43: End Sub
Line 44: End Class
Source File: c:\inetpub\wwwroot\NEWCrystalReports\StateSelect.a spx.vb
Line: 42

Stack Trace:
[HttpException (0x80004005): Error executing child request for
/NewCrystalReports/genericreport.asp.]
System.Web.HttpServerUtility.ExecuteInternal(IHttp Handler handler,
TextWriter writer, Boolean preserveForm, String path, String filePath,
String physPath, Exception error, String queryStringOverride) +3137343
System.Web.HttpServerUtility.Execute(String path, TextWriter writer,
Boolean preserveForm) +722
System.Web.HttpServerUtility.Transfer(String path, Boolean
preserveForm) +55
_Default.Button2_Click(Object sender, EventArgs e) in
c:\inetpub\wwwroot\NEWCrystalReports\StateSelect.a spx.vb:42
System.Web.UI.WebControls.Button.OnClick(EventArgs e) +105
System.Web.UI.WebControls.Button.RaisePostBackEven t(String
eventArgument) +78

System.Web.UI.WebControls.Button.System.Web.UI.IPo stBackEventHandler.RaisePostBackEvent(String
eventArgument) +7
System.Web.UI.Page.RaisePostBackEvent(IPostBackEve ntHandler
sourceControl, String eventArgument) +11
System.Web.UI.Page.RaisePostBackEvent(NameValueCol lection postData)
+33
System.Web.UI.Page.ProcessRequestMain(Boolean
includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint)
+5670


--------------------------------------------------------------------------------
Version Information: Microsoft .NET Framework Version:2.0.50215.44;
ASP.NET Version:2.0.50215.44

There is this line in the ASPX file itself:

<form method="post" id="form1" runat="server"
action="GenericReport.asp">

The server is running ASP.NET v2 (Windows 2003 Server with IIS 6) and I
am developing in VS .NET 2005.

Nov 19 '05 #2
How do I post to the existing ASP page from the ASP.NET page then?

"S. Justin Gengo" wrote:
Brent,

I'm pretty certain that you can't server.transfer from a new ASP.NET
application back to an old ASP application. Server.Transfer will try to makeyour ASP.NET application load the .asp page into it's runtime. That of
course can't happen since the code is foreign to it.

--
Sincerely,

S. Justin Gengo, MCP
Web Developer / Programmer

www.aboutfortunate.com

"Out of chaos comes order."
Nietzsche
"Brent White" <bw****@badgersportswear.com> wrote in message
news:11**********************@g14g2000cwa.googleg roups.com...
If you need more information, I'd be glad to give it, but I am
developing an ASPX page so that the user can select multiple values for a specific field, then pass them on (using Crystal Reports 10 on a
separate ASP page). Here is the code behind the button that will
launch the report (is in a file called StateSelect.aspx.vb:

Protected Sub Button2_Click(ByVal sender As Object, ByVal e As
System.EventArgs) Handles Button2.Click
Server.Transfer("/NewCrystalReports/genericreport.asp", True)
End Sub
When I launch the ASP page and hit the submit button, I get the
following error in the IE window:

Server Error in '/NEWCrystalReports' Application.
------------------------------------------------------------------------
--------
Error executing child request for /NewCrystalReports/genericreport.asp.
Description: An unhandled exception occurred during the execution of
the current web request. Please review the stack trace for more
information about the error and where it originated in the code.

Exception Details: System.Web.HttpException: Error executing child
request for /NewCrystalReports/genericreport.asp.

Source Error:
Line 40:
Line 41: Protected Sub Button2_Click(ByVal sender As Object, ByVal e As System.EventArgs) Handles Button2.Click
Line 42:
Server.Transfer("/NewCrystalReports/genericreport.asp", True)
Line 43: End Sub
Line 44: End Class
Source File: c:\inetpub\wwwroot\NEWCrystalReports\StateSelect.a spx.vb
Line: 42

Stack Trace:
[HttpException (0x80004005): Error executing child request for
/NewCrystalReports/genericreport.asp.]
System.Web.HttpServerUtility.ExecuteInternal(IHttp Handler handler,
TextWriter writer, Boolean preserveForm, String path, String filePath, String physPath, Exception error, String queryStringOverride) +3137343 System.Web.HttpServerUtility.Execute(String path, TextWriter writer, Boolean preserveForm) +722
System.Web.HttpServerUtility.Transfer(String path, Boolean
preserveForm) +55
_Default.Button2_Click(Object sender, EventArgs e) in
c:\inetpub\wwwroot\NEWCrystalReports\StateSelect.a spx.vb:42
System.Web.UI.WebControls.Button.OnClick(EventArgs e) +105
System.Web.UI.WebControls.Button.RaisePostBackEven t(String
eventArgument) +78

System.Web.UI.WebControls.Button.System.Web.UI.IPo stBackEventHandler.Rai
sePostBackEvent(String eventArgument) +7
System.Web.UI.Page.RaisePostBackEvent(IPostBackEve ntHandler
sourceControl, String eventArgument) +11
System.Web.UI.Page.RaisePostBackEvent(NameValueCol lection postData)
+33
System.Web.UI.Page.ProcessRequestMain(Boolean
includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint)
+5670


------------------------------------------------------------------------
-------- Version Information: Microsoft .NET Framework Version:2.0.50215.44;
ASP.NET Version:2.0.50215.44

There is this line in the ASPX file itself:

<form method="post" id="form1" runat="server"
action="GenericReport.asp">

The server is running ASP.NET v2 (Windows 2003 Server with IIS 6) and I am developing in VS .NET 2005.



--
Sent via .NET Newsgroups
http://www.dotnetnewsgroups.com
Nov 19 '05 #3

Response.Redirect

"Brent" wrote:
How do I post to the existing ASP page from the ASP.NET page then?

"S. Justin Gengo" wrote:
Brent,

I'm pretty certain that you can't server.transfer from a new ASP.NET
application back to an old ASP application. Server.Transfer will try to

make
your ASP.NET application load the .asp page into it's runtime. That of
course can't happen since the code is foreign to it.

--
Sincerely,

S. Justin Gengo, MCP
Web Developer / Programmer

www.aboutfortunate.com

"Out of chaos comes order."
Nietzsche
"Brent White" <bw****@badgersportswear.com> wrote in message
news:11**********************@g14g2000cwa.googleg roups.com...
If you need more information, I'd be glad to give it, but I am
developing an ASPX page so that the user can select multiple values for a specific field, then pass them on (using Crystal Reports 10 on a
separate ASP page). Here is the code behind the button that will
launch the report (is in a file called StateSelect.aspx.vb:

Protected Sub Button2_Click(ByVal sender As Object, ByVal e As
System.EventArgs) Handles Button2.Click
Server.Transfer("/NewCrystalReports/genericreport.asp", True)
End Sub
When I launch the ASP page and hit the submit button, I get the
following error in the IE window:

Server Error in '/NEWCrystalReports' Application.
------------------------------------------------------------------------
--------
Error executing child request for /NewCrystalReports/genericreport.asp.
Description: An unhandled exception occurred during the execution of
the current web request. Please review the stack trace for more
information about the error and where it originated in the code.

Exception Details: System.Web.HttpException: Error executing child
request for /NewCrystalReports/genericreport.asp.

Source Error:
Line 40:
Line 41: Protected Sub Button2_Click(ByVal sender As Object, ByVal e As System.EventArgs) Handles Button2.Click
Line 42:
Server.Transfer("/NewCrystalReports/genericreport.asp", True)
Line 43: End Sub
Line 44: End Class
Source File: c:\inetpub\wwwroot\NEWCrystalReports\StateSelect.a spx.vb
Line: 42

Stack Trace:
[HttpException (0x80004005): Error executing child request for
/NewCrystalReports/genericreport.asp.]
System.Web.HttpServerUtility.ExecuteInternal(IHttp Handler handler,
TextWriter writer, Boolean preserveForm, String path, String filePath, String physPath, Exception error, String queryStringOverride) +3137343 System.Web.HttpServerUtility.Execute(String path, TextWriter writer, Boolean preserveForm) +722
System.Web.HttpServerUtility.Transfer(String path, Boolean
preserveForm) +55
_Default.Button2_Click(Object sender, EventArgs e) in
c:\inetpub\wwwroot\NEWCrystalReports\StateSelect.a spx.vb:42
System.Web.UI.WebControls.Button.OnClick(EventArgs e) +105
System.Web.UI.WebControls.Button.RaisePostBackEven t(String
eventArgument) +78

System.Web.UI.WebControls.Button.System.Web.UI.IPo stBackEventHandler.Rai
sePostBackEvent(String eventArgument) +7
System.Web.UI.Page.RaisePostBackEvent(IPostBackEve ntHandler
sourceControl, String eventArgument) +11
System.Web.UI.Page.RaisePostBackEvent(NameValueCol lection postData)
+33
System.Web.UI.Page.ProcessRequestMain(Boolean
includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint)
+5670


------------------------------------------------------------------------
-------- Version Information: Microsoft .NET Framework Version:2.0.50215.44;
ASP.NET Version:2.0.50215.44

There is this line in the ASPX file itself:

<form method="post" id="form1" runat="server"
action="GenericReport.asp">

The server is running ASP.NET v2 (Windows 2003 Server with IIS 6) and I am developing in VS .NET 2005.



--
Sent via .NET Newsgroups
http://www.dotnetnewsgroups.com

Nov 19 '05 #4
Brent,

Yes, Sreejith is correct you need to use a Response.Redirect. And then
include the values you need to pass to the ASP page in the querystring.

--
Sincerely,

S. Justin Gengo, MCP
Web Developer / Programmer

www.aboutfortunate.com

"Out of chaos comes order."
Nietzsche
"Sreejith Ram" <Sr*********@discussions.microsoft.com> wrote in message
news:FD**********************************@microsof t.com...

Response.Redirect

"Brent" wrote:
How do I post to the existing ASP page from the ASP.NET page then?

"S. Justin Gengo" wrote:
>Brent,
>
>I'm pretty certain that you can't server.transfer from a new ASP.NET
>application back to an old ASP application. Server.Transfer will try to

make
>your ASP.NET application load the .asp page into it's runtime. That of
>course can't happen since the code is foreign to it.
>
>--
>Sincerely,
>
>S. Justin Gengo, MCP
>Web Developer / Programmer
>
>www.aboutfortunate.com
>
>"Out of chaos comes order."
> Nietzsche
>"Brent White" <bw****@badgersportswear.com> wrote in message
>news:11**********************@g14g2000cwa.googleg roups.com...
>> If you need more information, I'd be glad to give it, but I am
>> developing an ASPX page so that the user can select multiple values

for
>> a specific field, then pass them on (using Crystal Reports 10 on a
>> separate ASP page). Here is the code behind the button that will
>> launch the report (is in a file called StateSelect.aspx.vb:
>>
>> Protected Sub Button2_Click(ByVal sender As Object, ByVal e As
>> System.EventArgs) Handles Button2.Click
>> Server.Transfer("/NewCrystalReports/genericreport.asp", True)
>> End Sub
>>
>>
>> When I launch the ASP page and hit the submit button, I get the
>> following error in the IE window:
>>
>> Server Error in '/NEWCrystalReports' Application.
>>

------------------------------------------------------------------------
--------
>>
>> Error executing child request for

/NewCrystalReports/genericreport.asp.
>>
>> Description: An unhandled exception occurred during the execution of
>> the current web request. Please review the stack trace for more
>> information about the error and where it originated in the code.
>>
>> Exception Details: System.Web.HttpException: Error executing child
>> request for /NewCrystalReports/genericreport.asp.
>>
>> Source Error:
>>
>>
>> Line 40:
>> Line 41: Protected Sub Button2_Click(ByVal sender As Object,

ByVal
>> e As System.EventArgs) Handles Button2.Click
>> Line 42:
>> Server.Transfer("/NewCrystalReports/genericreport.asp", True)
>> Line 43: End Sub
>> Line 44: End Class
>>
>>
>> Source File: c:\inetpub\wwwroot\NEWCrystalReports\StateSelect.a spx.vb
>> Line: 42
>>
>> Stack Trace:
>>
>>
>> [HttpException (0x80004005): Error executing child request for
>> /NewCrystalReports/genericreport.asp.]
>> System.Web.HttpServerUtility.ExecuteInternal(IHttp Handler handler,
>> TextWriter writer, Boolean preserveForm, String path, String

filePath,
>> String physPath, Exception error, String queryStringOverride)

+3137343
>> System.Web.HttpServerUtility.Execute(String path, TextWriter

writer,
>> Boolean preserveForm) +722
>> System.Web.HttpServerUtility.Transfer(String path, Boolean
>> preserveForm) +55
>> _Default.Button2_Click(Object sender, EventArgs e) in
>> c:\inetpub\wwwroot\NEWCrystalReports\StateSelect.a spx.vb:42
>> System.Web.UI.WebControls.Button.OnClick(EventArgs e) +105
>> System.Web.UI.WebControls.Button.RaisePostBackEven t(String
>> eventArgument) +78
>>
>>

System.Web.UI.WebControls.Button.System.Web.UI.IPo stBackEventHandler.Rai
sePostBackEvent(String
>> eventArgument) +7
>> System.Web.UI.Page.RaisePostBackEvent(IPostBackEve ntHandler
>> sourceControl, String eventArgument) +11
>> System.Web.UI.Page.RaisePostBackEvent(NameValueCol lection postData)
>> +33
>> System.Web.UI.Page.ProcessRequestMain(Boolean
>> includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint)
>> +5670
>>
>>
>>
>>
>>

------------------------------------------------------------------------
--------
>> Version Information: Microsoft .NET Framework Version:2.0.50215.44;
>> ASP.NET Version:2.0.50215.44
>>
>>
>>
>>
>>
>> There is this line in the ASPX file itself:
>>
>> <form method="post" id="form1" runat="server"
>> action="GenericReport.asp">
>>
>>
>>
>>
>>
>> The server is running ASP.NET v2 (Windows 2003 Server with IIS 6) and

I
>> am developing in VS .NET 2005.
>>
>
>


--
Sent via .NET Newsgroups
http://www.dotnetnewsgroups.com

Nov 19 '05 #5
I don't suppose there's a way to pass the request parameters through
code instead of appending it to the URL, is there?

I ask because what I am passing is a filter selection for a Crystal 10
report that contains the States the report should be viewed for and the
report name itself (to lessen the number of ASP files I have to maintain
in the virtual directory), and that URL may be quite long and contain
some illegal characters.

--
Sent via .NET Newsgroups
http://www.dotnetnewsgroups.com
Nov 19 '05 #6
Brent,

The only other thing I can think of is a bit lengthy, but you could put a
literal control onto a page and then use the HttpWebRequest object to post
to the page with the included parameters and then render the results to the
literal.

That would look something like this:

***Also a word of warning. It took me a while to get this working (sorry it
took so long to post back) because I kept getting 405 Method not allowed
errors from the site I was testing this code against. It turned out that the
server was refusing the posted data because I was using fake parameters. You
have to post with each and every paramter named exactly as the page is
expecting and go directly to the page or you'll get that error.

'---Create the request
Dim WebRequest As System.Net.WebRequest
WebRequest = System.Net.WebRequest.Create(New
Uri(http://www.mysite.com/mypage.asp))

'---Optionally set the timeout (if you don't the default timeout will be
used)
WebRequest.Timeout = 2000

'---Create the post data
Dim PostData As String = "id=" & HttpUtility.UrlEncode("1234") & "&state=" &
HttpUtility.UrlEncode("WI")
WebRequest.Method = "POST"

Dim PostBuffer() As Byte =
System.Text.Encoding.GetEncoding(1252).GetBytes(Po stData)

WebRequest.ContentLength = PostBuffer.Length
WebRequest.ContentType = "application/x-www-form-urlencoded"

Dim PostDataStream As System.IO.Stream = WebRequest.GetRequestStream()
PostDataStream.Write(PostBuffer, 0, PostBuffer.Length)
PostDataStream.Close()

'---Get the response produced by the request
Dim Response As System.Net.WebResponse = WebRequest.GetResponse

'---Download the page content into a stream
Dim Stream As System.IO.Stream = Response.GetResponseStream

'---Place the stream into a stream reader
Dim StreamReader As New System.IO.StreamReader(Stream)

'---Read the stream into a string object
Dim Html As String = StreamReader.ReadToEnd

'---Cleanup for the next request
Stream.Close()
StreamReader.Close()

'---Place the page found into the literal control
Literal1.Text = Html

--
Sincerely,

S. Justin Gengo, MCP
Web Developer / Programmer

www.aboutfortunate.com

"Out of chaos comes order."
Nietzsche
"Brent" <bw****@badgersportswear.com> wrote in message
news:OQ****************@TK2MSFTNGP15.phx.gbl...
I don't suppose there's a way to pass the request parameters through
code instead of appending it to the URL, is there?

I ask because what I am passing is a filter selection for a Crystal 10
report that contains the States the report should be viewed for and the
report name itself (to lessen the number of ASP files I have to maintain
in the virtual directory), and that URL may be quite long and contain
some illegal characters.

--
Sent via .NET Newsgroups
http://www.dotnetnewsgroups.com

Nov 19 '05 #7
Another approach would be to create a table to hold the transaction data for
the report..

steps would be like this...

create a key value from asp.net page
save params for the report in the transaction table with the key , from
asp.net page
redirect to the asp page & pass the key using query string
read the parameters from asp page
delete the record in the transaction table for the key, from asp page..

What Justin suggested may be a better solution than this. if the crystal
report is being opened in the same window as asp page , would assigning the
response to literal work ? the Request.ContentType will need to be changed i
suppose. not sure..

"S. Justin Gengo" wrote:
Brent,

The only other thing I can think of is a bit lengthy, but you could put a
literal control onto a page and then use the HttpWebRequest object to post
to the page with the included parameters and then render the results to the
literal.

That would look something like this:

***Also a word of warning. It took me a while to get this working (sorry it
took so long to post back) because I kept getting 405 Method not allowed
errors from the site I was testing this code against. It turned out that the
server was refusing the posted data because I was using fake parameters. You
have to post with each and every paramter named exactly as the page is
expecting and go directly to the page or you'll get that error.

'---Create the request
Dim WebRequest As System.Net.WebRequest
WebRequest = System.Net.WebRequest.Create(New
Uri(http://www.mysite.com/mypage.asp))

'---Optionally set the timeout (if you don't the default timeout will be
used)
WebRequest.Timeout = 2000

'---Create the post data
Dim PostData As String = "id=" & HttpUtility.UrlEncode("1234") & "&state=" &
HttpUtility.UrlEncode("WI")
WebRequest.Method = "POST"

Dim PostBuffer() As Byte =
System.Text.Encoding.GetEncoding(1252).GetBytes(Po stData)

WebRequest.ContentLength = PostBuffer.Length
WebRequest.ContentType = "application/x-www-form-urlencoded"

Dim PostDataStream As System.IO.Stream = WebRequest.GetRequestStream()
PostDataStream.Write(PostBuffer, 0, PostBuffer.Length)
PostDataStream.Close()

'---Get the response produced by the request
Dim Response As System.Net.WebResponse = WebRequest.GetResponse

'---Download the page content into a stream
Dim Stream As System.IO.Stream = Response.GetResponseStream

'---Place the stream into a stream reader
Dim StreamReader As New System.IO.StreamReader(Stream)

'---Read the stream into a string object
Dim Html As String = StreamReader.ReadToEnd

'---Cleanup for the next request
Stream.Close()
StreamReader.Close()

'---Place the page found into the literal control
Literal1.Text = Html

--
Sincerely,

S. Justin Gengo, MCP
Web Developer / Programmer

www.aboutfortunate.com

"Out of chaos comes order."
Nietzsche
"Brent" <bw****@badgersportswear.com> wrote in message
news:OQ****************@TK2MSFTNGP15.phx.gbl...
I don't suppose there's a way to pass the request parameters through
code instead of appending it to the URL, is there?

I ask because what I am passing is a filter selection for a Crystal 10
report that contains the States the report should be viewed for and the
report name itself (to lessen the number of ASP files I have to maintain
in the virtual directory), and that URL may be quite long and contain
some illegal characters.

--
Sent via .NET Newsgroups
http://www.dotnetnewsgroups.com


Nov 19 '05 #8
Sreejith,

Good point. I was assuming that it's a web report. If it isn't then a
response.type coud be set to deliver the stream as a file.

--
Sincerely,

S. Justin Gengo, MCP
Web Developer / Programmer

www.aboutfortunate.com

"Out of chaos comes order."
Nietzsche
"Sreejith Ram" <Sr*********@discussions.microsoft.com> wrote in message
news:A4**********************************@microsof t.com...
Another approach would be to create a table to hold the transaction data
for
the report..

steps would be like this...

create a key value from asp.net page
save params for the report in the transaction table with the key , from
asp.net page
redirect to the asp page & pass the key using query string
read the parameters from asp page
delete the record in the transaction table for the key, from asp page..

What Justin suggested may be a better solution than this. if the crystal
report is being opened in the same window as asp page , would assigning
the
response to literal work ? the Request.ContentType will need to be changed
i
suppose. not sure..

"S. Justin Gengo" wrote:
Brent,

The only other thing I can think of is a bit lengthy, but you could put a
literal control onto a page and then use the HttpWebRequest object to
post
to the page with the included parameters and then render the results to
the
literal.

That would look something like this:

***Also a word of warning. It took me a while to get this working (sorry
it
took so long to post back) because I kept getting 405 Method not allowed
errors from the site I was testing this code against. It turned out that
the
server was refusing the posted data because I was using fake parameters.
You
have to post with each and every paramter named exactly as the page is
expecting and go directly to the page or you'll get that error.

'---Create the request
Dim WebRequest As System.Net.WebRequest
WebRequest = System.Net.WebRequest.Create(New
Uri(http://www.mysite.com/mypage.asp))

'---Optionally set the timeout (if you don't the default timeout will be
used)
WebRequest.Timeout = 2000

'---Create the post data
Dim PostData As String = "id=" & HttpUtility.UrlEncode("1234") &
"&state=" &
HttpUtility.UrlEncode("WI")
WebRequest.Method = "POST"

Dim PostBuffer() As Byte =
System.Text.Encoding.GetEncoding(1252).GetBytes(Po stData)

WebRequest.ContentLength = PostBuffer.Length
WebRequest.ContentType = "application/x-www-form-urlencoded"

Dim PostDataStream As System.IO.Stream = WebRequest.GetRequestStream()
PostDataStream.Write(PostBuffer, 0, PostBuffer.Length)
PostDataStream.Close()

'---Get the response produced by the request
Dim Response As System.Net.WebResponse = WebRequest.GetResponse

'---Download the page content into a stream
Dim Stream As System.IO.Stream = Response.GetResponseStream

'---Place the stream into a stream reader
Dim StreamReader As New System.IO.StreamReader(Stream)

'---Read the stream into a string object
Dim Html As String = StreamReader.ReadToEnd

'---Cleanup for the next request
Stream.Close()
StreamReader.Close()

'---Place the page found into the literal control
Literal1.Text = Html

--
Sincerely,

S. Justin Gengo, MCP
Web Developer / Programmer

www.aboutfortunate.com

"Out of chaos comes order."
Nietzsche
"Brent" <bw****@badgersportswear.com> wrote in message
news:OQ****************@TK2MSFTNGP15.phx.gbl...
>I don't suppose there's a way to pass the request parameters through
> code instead of appending it to the URL, is there?
>
> I ask because what I am passing is a filter selection for a Crystal 10
> report that contains the States the report should be viewed for and the
> report name itself (to lessen the number of ASP files I have to
> maintain
> in the virtual directory), and that URL may be quite long and contain
> some illegal characters.
>
> --
> Sent via .NET Newsgroups
> http://www.dotnetnewsgroups.com


Nov 19 '05 #9

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

Similar topics

303
by: mike420 | last post by:
In the context of LATEX, some Pythonista asked what the big successes of Lisp were. I think there were at least three *big* successes. a. orbitz.com web site uses Lisp for algorithms, etc. b....
12
by: Adam Lipscombe | last post by:
Folks, I need to get the contents of a form attribute. In Read/Write mode this is field, so I can use getElementById("name").value In ReadOnly this is just plain text, so I can use...
27
by: Richard Blewett [DevelopMentor] | last post by:
I've just seen on Eric Gunnerson's blog that C# is getting Edit and Continue in Whidbey. That will please alot of people - although me, I have mixed feelings about it ;-) ...
6
by: hemant.singh | last post by:
Hi all, I am trying to get a way by which I'll know exactly when user goes out of my site by clicking on close button in browser, So that w/e user click close button in browser, I can send a...
6
by: WT | last post by:
Hello, Using VS2005. I have an assembly library that can be called from a Web site asp.net application or from a winform application. From this library I need to retrieve a path using simply a...
41
by: Jim | last post by:
Hi guys, I have an object which represents an "item" in a CMS "component" where an "item" in the most basic form just a field, and a "component" is effectively a table. "item" objects can be...
22
by: Sri | last post by:
All Recenetly our shop migrated to DB2 V8 from V7. We are in IBM System Level: z/OS 1.6.1 @ RSU 0702. Processor : IBM 2064-1C7 (z/900) # 1B89 Mode: 64-bit One of my application is facing...
33
by: JamesB | last post by:
I am writing a service that monitors when a particular app is started. Works, but I need to get the user who is currently logged in, and of course Environment.UserName returns the service logon...
4
by: SAL | last post by:
Hello, I'm working, basically my first, AJAX page and am having a few problems. One is that the Click event for a button I have in UpdatePanel1 is not getting called. I've tried with the button...
0
by: ryjfgjl | last post by:
ExcelToDatabase: batch import excel into database automatically...
0
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
1
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: Vimpel783 | last post by:
Hello! Guys, I found this code on the Internet, but I need to modify it a little. It works well, the problem is this: Data is sent from only one cell, in this case B5, but it is necessary that data...
0
by: ArrayDB | last post by:
The error message I've encountered is; ERROR:root:Error generating model response: exception: access violation writing 0x0000000000005140, which seems to be indicative of an access violation...
1
by: Shællîpôpï 09 | last post by:
If u are using a keypad phone, how do u turn on JavaScript, to access features like WhatsApp, Facebook, Instagram....
0
by: af34tf | last post by:
Hi Guys, I have a domain whose name is BytesLimited.com, and I want to sell it. Does anyone know about platforms that allow me to list my domain in auction for free. Thank you
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 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 former...

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.