Hi,
I'm connecting to a remote server page(Iframe
Src="http://somepage.aspx"), which has two dropdownlists for search
criteria, which generates a report and then downloading this report as a
pdf file, using response.writefile.But once the file is downloaded, the
when I change the selection in the DropDowns, it gives "Access denied"
error.
I'm accessing the Cache & Session objects in PageLoad and doing a
dataview.filter in the SelectedIndexChanged Event.Does anyone have any
idea on what could be wrong.
Thanx in Advance,
Deepa
*****************************************************************
---------Function to download pdf file-------
Protected Function push_to_client()
Dim file_pdf As New FileInfo(report_pdf_file)
Response.Clear()
Response.Buffer = True
Response.AddHeader("Content-Disposition", "attachment; filename="
& file_pdf.Name)
Response.AddHeader("Content-Length", file_pdf.Length.ToString)
Response.ContentType = "application/octet-stream"
Response.WriteFile(report_pdf_file)
Response.Flush()
Response.Close()
Response.End()
End Function
---------ddl_selectedIndexChanged-----------
Protected Sub ddl_State_SelectedIndexChanged(ByVal sender As Object, ByVal
e As System.EventArgs) Handles ddl_City.SelectedIndexChanged
Session("Filter") = True
Session("Prev_State") = ddl_State.SelectedItem.Value
set_City()
End Sub
Public Function set_City()
ds_ProviderData.Tables("City_List").DefaultView.RowFilter
= "StateId = '" & Session.Item("Selected_state") & "'"
ddl_City.DataSource = ds_ProviderData.Tables
("City_List").DefaultView
ddl_City.DataTextField = ds_ProviderData.Tables
("City_List").Columns.Item(1).ToString
ddl_City.DataValueField = ds_ProviderData.Tables
("City_List").Columns.Item(1).ToString
ddl_City.DataBind()
ddl_City.Items.Insert(0, "Select One")
If Session.Item("Filter") Then
ddl_City.Items.Item(0).Selected = False
ddl_City.Items.FindByText(Session.Item("City")).Selected = True
Else
ddl_City.Items.Item(0).Selected = True
End If
End Function
*******************************************************************