ASP.NET 2.0 - Accessing controls in the previous page

Rate It (3)

Last post 08-07-2009 3:49 AM by prabhat chandra prabhakar. 17 replies.

Sort Posts:

  • Re: ASP.NET 2.0 - Accessing controls in the previous page

    03-05-2009, 6:09 AM

    Hi,

    Try accessing the previous page control value like this,

    Source page :

    <asp:TextBox runat="server" id="_txtName" /> <br />
    <asp:Button runat="server" PostBackUrl="targetpage.aspx" text="Next" />


    In the code behind of targetpage.aspx,

    string name = Request["_txtName"];


     

  • Re: ASP.NET 2.0 - Accessing controls in the previous page

    08-06-2009, 8:56 AM
    • Member
      2 point Member
    • MariuSama
    • Member since 08-06-2009, 12:10 PM
    • Posts 1
    Hello, I found this post really interesting, but I have yet another doubt regarding access to previous page information. I have a web application called from a corporate portal, and Ive been asked to extract the ID of the user logged in the corporate web, in order to perform a Silent log-in in the web application and thus the "Insert id and password" page doesnt appear. The problem is, the web do not store the logged User ID in the Session variable, and when invoquing the Gateway that logs-in and calls the web application, it seems the Context from the previous page is not passed to the aspx class that implements the Gateway. Ive tried using: * Context.User.Identity.Name -> It returns NULL * System.Security.Principal.WindowsIdentity.GetCurrent().Name -> It returns 'NT AUTHORITY\SYSTEM', no matter the logged user in the corporate web. * HttpContext.Current.User.Identity.Name -> It returns NULL Ive thought maybe accessing the previous page Context will help to retrieve the correct User ID, but when accessing it, it doesnt let me access the Context variable, and it seems "System" is not a valid atribute in "Page" class. Maybe this line will do it? Page prevPage = PreviousPage; prevPage.User.Identity.Name Changing the corporate web so it stores the User ID in the Session variable is not possible. Changing anything in the corporate web so things are a bit easier for me to implement is not possible :( Is there any way of getting the User ID from the previous page? Thanks in advance.
  • Re: ASP.NET 2.0 - Accessing controls in the previous page

    08-07-2009, 3:49 AM

    From my point of view You Should Use session because for small data session is good amoung all query string cookies

    crosspagepostback and find control

                              thanks


Page 2 of 2 (18 items) < Previous 1 2