467,077 Members | 1,026 Online
Bytes | Developer Community
Ask Question

Home New Posts Topics Members FAQ

Post your question to a community of 467,077 developers. It's quick & easy.

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
  • viewed: 1555
Share:
8 Replies
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 discussion thread is closed

Replies have been disabled for this discussion.

Similar topics

303 posts views Thread by mike420@ziplip.com | last post: by
12 posts views Thread by Adam Lipscombe | last post: by
27 posts views Thread by Richard Blewett [DevelopMentor] | last post: by
41 posts views Thread by Jim | last post: by
33 posts views Thread by JamesB | last post: by
4 posts views Thread by SAL | last post: by
By using this site, you agree to our Privacy Policy and Terms of Use.