locked
how to pass values between pages in asp.net-id printer RRS feed

  • Question

  • Hi there

    Iam making a web application that is going to print Id cards using aspx.cs. Right now I am able to create a new user on page 1 and I want to be able to pass all the information from that user into page 2 so i can print an id card. On page 2 I was formatting everything with labels so I need to be able to get everything on page 1 into the labels of page 2.I did it with sessions first and that works.. but is there a better way for storring all the information for one single person?.

    page 1 current code newrecord.aspx.cs

    summitbutton(object sende, eventArgs e)

    sqldsNewrecord.insertParameters["name"].defaultValue=txtName.text;

    sqldsNewrecord.insertParameters["Company"].defaultValue=txtCompany.text;

    Session["name"]=txtname.text;

    Session["company"]=txtCompany.text;

    print button

    {

    Response.redirect("print.aspx);

    }

    Page 2 print.aspx.cs

    page load

    {

    lblname.text=session["name"].Tostring();

    lblCompany.text=session["company"].ToString();

    }

    there are going to be around 6 items that i need to pass over in excluding the photo of the user which I want to pass separately. I dont want to have 6 different sessions on each page. is there a better way for this? also is an mvc project

    • Moved by Amanda Zhu Tuesday, October 22, 2013 11:11 AM
    Monday, October 21, 2013 4:35 PM

Answers

  • Hello,

    Thank you for your post.

    I am afraid that the issue is out of support range of VS General Question forum which mainly discusses WPF & SL designer, Visual Studio Guidance Automation Toolkit, Developer Documentation and Help System and Visual Studio Editor.

    Since your issue is related to ASP.NET MVC project development, I suggest that you can consult your issue on ASP.NET forum: http://forums.asp.net/  for better solution and support.

    Best regards,


    We are trying to better understand customer views on social support experience, so your participation in this interview project would be greatly appreciated if you have time. Thanks for helping make community forums a great place.
    Click HERE to participate the survey.

    • Proposed as answer by Just Karl Monday, October 28, 2013 9:11 PM
    • Marked as answer by Just Karl Friday, November 1, 2013 5:45 PM
    Tuesday, October 22, 2013 11:10 AM