Server Transfer method issues

thussain

Newcomer
Joined
Jul 23, 2004
Messages
2
This is the second post. Please Help !

My problem is I am using server.transfer("secondform") method which when finish running if user use browser back button to go back to firstform it loss all the user selection criteria.

Second issue I am having is when user use Excel Export the whole criteria form get loss and I end up having a browser page with Excle Spreadsheet in it. I can' go to crietria page any more unless I close the Browser and start over.


I use the Server.Transfer method to pass data from one form to another using the technique

http://www.aspalliance.com/das/passingdata.aspx


Here is the code I use to Export Data to Excel from Datagrid

Public Shared Sub DataGridToExcel(ByVal dgExport As DataGrid, ByVal response As HttpResponse)
'clean up the response.object

response.Clear()
response.Charset = ""
'set the response mime type for excel
response.ContentType = "application/vnd.ms-excel"
'create a string writer
Dim stringWrite As New System.IO.StringWriter()
'create an htmltextwriter which uses the stringwriter
Dim htmlWrite As New System.Web.UI.HtmlTextWriter(stringWrite)

'instantiate a datagrid
Dim dg As New DataGrid()
' just set the input datagrid = to the new dg grid
dg = dgExport

' Make the header text bold
dg.HeaderStyle.Font.Bold = True


'tell the datagrid to render itself to our htmltextwriter
dg.RenderControl(htmlWrite)
'output the html
response.Write(stringWrite.ToString)
response.End()
End Sub


Can you guys give me suggestion how to do it correctly.


Please help!


Thanks
Tanweer
 
Back
Top