Click here to Skip to main content
15,891,423 members
Please Sign up or sign in to vote.
1.00/5 (1 vote)
See more:
My Db table name is tblTransaction.. N my first page is order.aspx on which i have my TableId,TableSeatI... these values i want in print.aspx page.... so ho can access these id's & from them there records..???? please help me

What I have tried:

i dont know how to transform id from one page to another
Posted
Updated 7-Aug-17 3:25am

The simplest and clean way is to send these field values as query strings in URL. I assume you are opening print.aspx page from order.aspx.

e.g. print.aspx?TableId={TableIdValue}&TableSeatId={TableSeatIdValue}

This URL can be created on server as well as client side (JS).
 
Share this answer
 
Comments
Member 13303325 15-Jul-17 0:20am    
How to pass through url...???
Atlapure Ambrish 15-Jul-17 9:25am    
Just read the value of controls/fields and append while preparing URL. For example on client side, find the control and fetch its 'value' and append. Same applies for server side code as well. In my example in the solution, you just need to replace actual values for place holders {TableIdValue} and {TableSeatIdValue}.
Luqman Moideen 17-Jul-17 1:06am    
you can pass through ajax call. Using data in ajax call. you can pass many ids or anything through this.
You could store the ID inside a Session Variable and then call it wherever you want!

C#
var Id1;
var Id2;
Session["FirstID"] = Id1;
Session["SecondID"] = Id2;

If you would like to call it then on another page then you siply do this:

C#
var GetID1 = Convert.ToInt32(Session["FirstID"]);
var GetID2 = Convert.ToInt32(Session["SecondID"]);


The values will be retrieved from the Session and put inside GetID1,GetID2 Variables..

I hope this helps you out!
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900