locked
i would like to send multiple values on another page without using session and querystring RRS feed

  • Question

  • User-1367813752 posted

    Actually we have two pages. on first page in griedview their is a link button. when we press this link button using querystirng we pass multiple values on second page. now we would like to chagne in code and want to remove querystring and we also dont want to use Session variable to pass values. is their any process to pass values from one page to another page.

    Thanks

    Thursday, April 18, 2019 5:26 AM

All replies

  • User283571144 posted

    Hi umeshdaiya@gmail.com,

    According to your description, I suggest you could consider using post to pass values from one page to another page.

    For example, you could use asp.net web form button's PostBackUrl property to achieve your requirement.

      <form id="form1" runat="server">
    
        <h3>Button.PostBackUrl Example</h3>
    
        Enter a value to post:
        <asp:textbox id="TextBox1" 
          runat="Server">
        </asp:textbox>
    
        <br /><br />
    
        <asp:button id="Button1" 
          text="Post back to this page"
          runat="Server">
        </asp:button>
    
        <br /><br />
    
        <asp:button id="Button2"
          text="Post value to another page" 
          postbackurl="PostBackUrlPage2.aspx" 
          runat="Server">
        </asp:button>
    
      </form>

    In PostBackUrlPage2.aspx code-behind:

            protected void Page_Load(object sender, EventArgs e)
            {
                Response.Write($"Form value: {Request.Form["TextBox1"]}");
            }

    Result:

    Best Regards,

    Brando

    Thursday, April 18, 2019 8:26 AM
  • User1308270069 posted

    you can use Page.Value1, Page.Value2 and ...

    Or you can use <g class="gr_ gr_70 gr-alert gr_gramm gr_inline_cards gr_run_anim Grammar only-ins replaceWithoutSep" id="70" data-gr-id="70">App</g>.Value1, App.Value2 and ...

    Tuesday, May 21, 2019 7:01 AM
  • User-659827440 posted
    Hi Umesh,
    You can user http request object to pass data from one page to another page that is controller. In this case you have to add the key values to the http request. Hope this helps.
    Saturday, May 25, 2019 2:53 PM
  • User-1038772411 posted

    Using the reference in the PreviousPage property, you can search for controls on the source page and extract their value. You typically do this with the FindControl method.

    use PreviousPage.FindControl("yourcontrolname")

    these link may help you

    Wednesday, May 29, 2019 8:38 AM
  • User379720387 posted

    set a variable

    Session["isprovisioned"] = "true"

    retrieve a variable

    flag  = Convert.ToBoolean(Session["isprovisioned"]);

    clear it

    Session.Remove("isprovisoned")

    Wednesday, May 29, 2019 9:10 PM