Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Alternative to Session Variable 2

Status
Not open for further replies.

LonnieJohnson

Programmer
Apr 16, 2001
2,628
US
I was wondering how I can pass a string from one page to another? I am using VS 2005.

I have a data grid on one page and I am opening another page with a grid and want to pass the sql of from the grid on page one to the gird on page two.

I was using a session varible but it seems unstable. The sql string value does not always see to carry over.

Thanks in advance.

ProDev, MS Access Applications
Visit me at ==>
May God bless you beyond your imagination!!!
 
How many records? Are you worried about speed?

1. Load the same data into a second hidden grid that is print only? User can still print via any button.

2. Force a postback, turning off pagination, rebind the grid, send the page to the printer. Redirect back to same page ready for more selections (window.onafterprint). This option would not allow the user to click the IE print button

3. Might be able to do some javascript trickery to postback, unpaginate, print, and repaginate in one step.

4. Get back on the passing sql parameters to a whole new page.


if you are on an intranet and have a fine tuned stored procedure building your results, option 1 could be nifty.
 
Ok. I acquired some java script based on your suggetions and I was able to print my grid. So since I have the AllowPaging turned on, I also took your advice on a second grid. However, it prints blank and I also do not know how to make the div tag disappear.

Here is the javascript I am using...






ProDev, MS Access Applications
Visit me at ==>
May God bless you beyond your imagination!!!
 
it might be helpful if you could post some of your html so we can see where it stands... trim out any of the datagrid guts, and confidential info, but be sure to show the div tags and javascript and asp controls.

from the link you posted, i dont see why its having you postback. If you arent running any serverside events, you can do this to a button...

<asp:button ID="btnPrint" onClientClick="CallPrint('divPrint');return false;" Runat=Server />

i might be confused, and get confusing, so some examples from you might help gear the answer better.
 
sry, not onclientclick, its still onClick

<asp:button ID="btnPrint" onClick="CallPrint('divPrint');return false;" Runat=Server />
 
First of all Adam, let me thank you for all your help. I have it working. I needed to take away the height and width on the div tags. Also I went ahead with one grid with no paging.

This seems to work for the users for now. I will have to do something fancier with dynamic crystal reporting later.

Thanks again for everyones help. ca8msm and jbenson001 seems to be faithful in every post.

ProDev, MS Access Applications
Visit me at ==>
May God bless you beyond your imagination!!!
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top