PostBackURL

Discussion in 'ASP .Net' started by sck10, Nov 22, 2006.

  1. sck10

    sck10 Guest

    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
     
    sck10, Nov 22, 2006
    #1
    1. Advertising

  2. 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" <> wrote in message
    news:...
    > 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
    >
     
    Eliyahu Goldin, Nov 22, 2006
    #2
    1. Advertising

  3. 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.
     
    Steven Cheng[MSFT], Nov 22, 2006
    #3
  4. sck10

    sck10 Guest

    Thanks Eliyahu,


    "Eliyahu Goldin" <> wrote in
    message news:...
    > 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" <> wrote in message
    > news:...
    >> 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
    >>

    >
    >
     
    sck10, Nov 22, 2006
    #4
  5. sck10

    sck10 Guest

    Thanks Steven, Appreciate it...


    "Steven Cheng[MSFT]" <> wrote in message
    news:...
    > 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.
    >
    >
     
    sck10, Nov 22, 2006
    #5
    1. Advertising

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

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. ABC
    Replies:
    6
    Views:
    4,107
    Bruce Barker
    Oct 7, 2005
  2. Rob Meade

    ImageButon: PostBackURL

    Rob Meade, Dec 4, 2005, in forum: ASP .Net
    Replies:
    1
    Views:
    1,569
    Teemu Keiski
    Dec 4, 2005
  3. bill

    PostBackURL to new window

    bill, Feb 10, 2006, in forum: ASP .Net
    Replies:
    3
    Views:
    18,447
  4. osh
    Replies:
    1
    Views:
    6,053
  5. Fabio Mastria
    Replies:
    2
    Views:
    2,589
Loading...

Share This Page