Note that there are some explanatory texts on larger screens.

plurals
  1. POReturn Value From Session
    primarykey
    data
    text
    <p>Just small question as I cannot find an answer that resolves my problem.</p> <p>I have an ASP page which sends input to a database and then creates a session. I would like to know how to return a certain value in that session on <strong>another</strong> aspx page.</p> <p>page1.aspx.cs [creates session]</p> <pre><code>public partial class new_questionnaire : System.Web.UI.Page { OscarSQL c; protected void Page_Load(object sender, EventArgs e) { c = new OscarSQL(); } // End Page_Load ////// Button Method ////// protected void NewQnrButton_Click(object sender, EventArgs e) { // Check if the input fields are empty. if (QuestionnaireName.Text == "" || CustomerID.Text == "" || NumberOfQuest.Text == "") { Error.Text = "Please enter a name for your questionnaire."; } // Parse input values to OscarSQL. else { int testRet = c.InsertQuestionnaire(QuestionnaireName.Text, Int32.Parse(CustomerID.Text), Int32.Parse(NumberOfQuest.Text)); Session["Questionnaire"] = testRet; Confirm.Text = "Your questionnaire has been named " + QuestionnaireName.Text; Response.Redirect("~/add_questions.aspx"); } } // End NewQNRButton_Click } // End new_questionnaire </code></pre> <p>Page2.aspx.cs [Would like value to be parsed here]</p> <pre><code>namespace OSQARv0._1 { public partial class WebForm2 : System.Web.UI.Page { protected void Page_Load(object sender, EventArgs e) { //ReturnQnrName.Text here? } } } </code></pre> <p>I would like the value QuestionnaireName.Text from <strong>Page1</strong> to be returned to ReturnQnrName.Text on <strong>Page2</strong></p>
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload