PostBackURL

S

sck10

Hello,

Can you use the PostBackUrl to post to different sites? I have a page
(PostBackURL.aspx' ) on one website (same server) that has a button set to:

PostBackURL="http://zone1.web.com"

When the second page opened, and tried to get a hidden value on the previous
page, I got the following error:

The file '/xaspx/zTest/PostBackURL.aspx' does not exist.

this.hdnQV01.Value =
((HiddenField)PreviousPage.FindControl("hdnCourse")).Value;

Any help with this would be appreciated.

Thanks, sck10
 
E

Eliyahu Goldin

From the MSDN:
--------
If the source and target page are in different applications, you cannot
directly get the values of controls on the page, but you can read the posted
data from the Form dictionary. You cannot read view state from the source
page, because it is hashed. If you want to store values in the source page
and make them available in a target page in another application, you can
store the values as strings inside hidden fields on the source page and
access them through Request.Form on the target page.
 
S

Steven Cheng[MSFT]

Hello Steve,

From your description, what you want to do is post data from one of your
ASP.NET application to another ASP.NET application hosted on a remote
server, correct?

Based on the code snippet you provided, it seems you're using the cross
page posting in ASP.NET 2.0 for pages in separate web application(server)
,yes ? If so, I'm afraid this is not supported, crosspage posting can only
be used in pages within the same ASP.NET web application. For your
scenario, if you have an html input hidden field in the source page(who
send the post to target page), you can use its "name" to retrieve its value
from the Request.Form collection. e.g.

=====in target page=========

protected void Page_Load(object sender, EventArgs e)
{

string value = Request.Form["hdnCourse"];
....................

}
==================

Does this work for you? Please feel free to let me know if there is any
other concern here.

Sincerely,

Steven Cheng

Microsoft MSDN Online Support Lead



==================================================

Get notification to my posts through email? Please refer to
http://msdn.microsoft.com/subscriptions/managednewsgroups/default.aspx#notif
ications.



Note: The MSDN Managed Newsgroup support offering is for non-urgent issues
where an initial response from the community or a Microsoft Support
Engineer within 1 business day is acceptable. Please note that each follow
up response may take approximately 2 business days as the support
professional working with you may need further investigation to reach the
most efficient resolution. The offering is not appropriate for situations
that require urgent, real-time or phone-based interactions or complex
project analysis and dump analysis issues. Issues of this nature are best
handled working with a dedicated Microsoft Support Engineer by contacting
Microsoft Customer Support Services (CSS) at
http://msdn.microsoft.com/subscriptions/support/default.aspx.

==================================================



This posting is provided "AS IS" with no warranties, and confers no rights.
 
S

sck10

Thanks Eliyahu,


Eliyahu Goldin said:
From the MSDN:
--------
If the source and target page are in different applications, you cannot
directly get the values of controls on the page, but you can read the
posted data from the Form dictionary. You cannot read view state from the
source page, because it is hashed. If you want to store values in the
source page and make them available in a target page in another
application, you can store the values as strings inside hidden fields on
the source page and access them through Request.Form on the target page.

-------

So try the Request.Form.
--
Eliyahu Goldin,
Software Developer & Consultant
Microsoft MVP [ASP.NET]



sck10 said:
Hello,

Can you use the PostBackUrl to post to different sites? I have a page
(PostBackURL.aspx' ) on one website (same server) that has a button set
to:

PostBackURL="http://zone1.web.com"

When the second page opened, and tried to get a hidden value on the
previous page, I got the following error:

The file '/xaspx/zTest/PostBackURL.aspx' does not exist.

this.hdnQV01.Value =
((HiddenField)PreviousPage.FindControl("hdnCourse")).Value;

Any help with this would be appreciated.

Thanks, sck10
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,755
Messages
2,569,534
Members
45,008
Latest member
Rahul737

Latest Threads

Top