Any time i try to change the DropDownList I get a javascript error which
says "Error: 'WebForm_PostBackOptions' is undefined"
How can I restore this?
VB Code is as follows.
Private Sub Page_Load(ByVal sender As System.Object, ByVal e As
System.EventArgs) Handles MyBase.Load
'Put user code to initialize the page here
If Not IsPostBack Then
SqlDAUsers.Fill(DsUsers1)
DropDownList1.DataBind()
' DataGrid1.DataBind()
' dvUsers1.RowFilter = "Userkey = " & Me.ViewState("DropDownList1") '&
DsUsers1.Users.UserKeyColumn.ToString()
txtFirstName.DataBind()
txtLastName.DataBind()
SqlDARulesLookup.SelectCommand.Parameters.Item(1).Value =
DropDownList1.SelectedItem.Value
SqlDARulesLookup.Fill(DsRulesLookup1)
DataGrid2.DataBind()
End If
' Response.Write("Selected - " + DropDownList1.SelectedItem.Value)
' Response.Write("Uber Select - " & DropDownList1.SelectedIndex)
End Sub
Private Sub DropDownList1_SelectedIndexChanged(ByVal sender As
System.Object, ByVal e As System.EventArgs) Handles
DropDownList1.SelectedIndexChanged
' txtFirstName.Text = DsUsers1.Users.FirstNameColumn.ToString
' txtLastName.Text = DsUsers1.Users.LastNameColumn.ToString
dvUsers1.RowFilter = "Userkey = " & DsUsers1.Users.UserKeyColumn.ToString()
txtFirstName.DataBind()
txtLastName.DataBind()
Response.Write("SelectedIndex!")
End Sub
Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As
System.EventArgs) Handles Button1.Click
Dim strSQLQuery As String
strSQLQuery = "UPDATE Users " _
& "SET FirstName = '" & Replace(txtFirstName.Text, "'", "''") & "', " _
& "LastName = '" & Replace(txtLastName.Text, "'", "''") & "' " _
& "WHERE UserKey = " & DropDownList1.SelectedItem.Value & ";"
'Response.Write(strSQLQuery)
SqlSaveCommand.CommandText = strSQLQuery
SqlUsers.Open()
SqlSaveCommand.ExecuteNonQuery()
SqlUsers.Close()
'update datasets?
End Sub
Private Sub Button2_Click(ByVal sender As System.Object, ByVal e As
System.EventArgs) Handles Button2.Click
' Define Crystal Reports variables
Dim crReportDocument As ReportDocument
Dim crExportOptions As ExportOptions
Dim crDiskFileDestinationOptions As DiskFileDestinationOptions
Dim Fname As String
' The following code can be placed directly after the call to
' InitializeComponent() in the form's constructor, or inside of
' a Button_Click event where the button is used by the client to
' get a printable copy of the report.
crReportDocument = New ReportDocument()
' The following line of code loads the sample report "Chart.rpt" that
installs
' with Visual Studio .NET
crReportDocument.Load("C:\Inetpub\wwwroot\WebApplication3\CrystalReport2.rpt")
Fname = "C:\inetpub\wwwroot\WebApplication3\" & Session.SessionID.ToString &
".pdf"
crDiskFileDestinationOptions = New DiskFileDestinationOptions()
crDiskFileDestinationOptions.DiskFileName = Fname
crExportOptions = crReportDocument.ExportOptions
With crExportOptions
..DestinationOptions = crDiskFileDestinationOptions
..ExportDestinationType = ExportDestinationType.DiskFile
..ExportFormatType = ExportFormatType.PortableDocFormat
End With
crReportDocument.Refresh()
crReportDocument.Export()
' The following code writes the pdf file to the Client's browser.
Response.ClearContent()
Response.ClearHeaders()
Response.ContentType = "application/pdf"
Response.WriteFile(Fname)
Response.Flush()
Response.Close()
'delete the exported file from disk
System.IO.File.Delete(Fname)
End Sub
End Class