AutoPostBack Problems


R

riley.derrick

To all the ASP.NET 2.0 Gurus, I am having a bit of a problem. Here is
the situation. I have a created a web form that does the following.
Has 2 dropdown lists that are databound to a SQL Datasource. Has 2
calendar controls with 2 dropdowns (month/year) per Calendar. The
calendars are edited/modified so that the user can choose a Month and a
Year for a particular calendar and the calendar control updates and
displays that particular month and year. The user then clicks the date
on the calendar and populates a textbox below. Below that I have a
bunch of other fields reading in data from user input.

Problem: The 2 dropdowns for the calendar controls are formatted like:

<asp:DropDownList id="drpCalMonth" Runat="Server" AutoPostBack="True"
OnSelectedIndexChanged="Set_Calendar"
cssClass="calTitle"></asp:DropDownList>

The calendar controls are the only fields that are set, AutoPostBack
='True". All the other fields are not. When I view the page in the
browser (IE) it displays fine. I have no problem with my 2 databound
dropdowns. When I click on a dropdown for one of the Calendar Controls,
(Ex: August --> October), the page refreshs and I get a "The page can
not be displayed" message. If I go into the ASP Page and change all
AutoPostBack="True" --> "False", reload the page and try again, I do
not get any errors, but the calendar doesn't update based on the
dropdowns I have chosen. Any ideas would be great.

Code below:
Page Load Event:

'Sets up Active Directory Security
Dim bIsFranshise As Boolean = IsFranchise()
Dim bIsServices As Boolean = IsServices()

If bIsServices Then
SqlDataSource1.SelectCommand = SqlDataSource1.SelectCommand
& " and [region_code] = '" & myRegion() & "'"
ElseIf bIsFranshise Then
SqlDataSource1.SelectCommand = SqlDataSource1.SelectCommand
& " and [territory] = '" & myTerritory() & "'"
End If
SqlDataSource1.SelectCommand = SqlDataSource1.SelectCommand & "
order by active_customer_log.acct_no "

If bIsFranshise Then
SqlDataSource2.SelectCommand = SqlDataSource2.SelectCommand
& " and [territory] = '" & myTerritory() & "'"
End If
SqlDataSource2.SelectCommand = SqlDataSource2.SelectCommand & "
order by [rank]"

'Hide the title of the calendar control
calStart.ShowTitle = False
calEnd.ShowTitle = False

'Populate month and year dropdown list boxes which
'replace the original calendar title
If Not Page.IsPostBack Then

Call Populate_MonthList()

Call Populate_YearList()
End If

End Sub
 
Ad

Advertisements


Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top