passing data from one page to another

Results 1 to 2 of 2

Thread: passing data from one page to another

  1. #1
    Join Date
    Dec 1969

    Default passing data from one page to another

    I have a .aspx page (we&#039;ll call it Form1) with a <BR>datagrid on it. The datagrid is populated from a dataset <BR>that I manually entered data into (the data isn&#039;t in a <BR>database). The datagrid on Form1 also has a button column <BR>on it.<BR> I have another .aspx page (Form2) with an <BR>unpopulated datagrid on it. I want to populate it with <BR>all the columns from the row where the button was clicked <BR>on Form1.<BR> I know how to do what I want with the datagrid <BR>formatting. I know how to open the second page with <BR>javascript. I just don&#039;t know how to pass the row from <BR>Form1 to Form2. It has been recommended to me to use a <BR>Cache but I don&#039;t know where to begin. I know how to add <BR>the data to a cache, but how do I access it from the <BR>second page?<BR><BR>Any help is greatly appreciated.<BR><BR>Thank you,<BR><BR>Brian Smith<BR>.<BR><BR>

  2. #2
    Join Date
    Dec 1969

    Default RE: passing data from one page to another

    To store a value in the cache:<BR> Cache("Name") = "Brian Smith"<BR>To retrieve a value, simlpy reverse the syntax:<BR> Value = Cache("Name")<BR><BR>You may also navigate to your second .aspx page and pass the parameters of the row that has been clicked using an Event Handler function in the codebehind of Form1 that captures the button click:<BR><BR>&#060;asp:Datagrid .... OnItemCommand="EventHandlerName"&#062;<BR>&#060;Co lumns&#062;<BR>&#060;asp:ButtonColumn DataField="DataFieldName"/&#062;<BR>....<BR>&#060;/Columns&#062;<BR>&#060;/asp:Datagrid&#062;<BR><BR>CodeBehind:<BR>Public Sub EventHandlerName(ByVal sender As Object, ByVal e As DataGridCommandEventArgs)<BR>&#039; Access each column like this:<BR>e.Item.Cells(ColumnIndex).Text<BR>End Sub<BR><BR><BR>

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts