I apologize if this bug has already been covered. I looked through the posts and could not find any threads about it so I decided to post what I discovered. Hope this helps.
To simulate:
1. log in as admin
2. navigate to events_list
3. click "List View"
4. click the green rollover button "Remove"
5. you are redirected to Events_Edit.aspx
6. The event is not removed.
Fix:
Under Begin News Item comment, under <asp:repeater...>, within <ItemTemplate>, and within <asp:panel ID=panel2...>, the line
This fix passes the correct parameter value to "action" that is defined in the events_edit.aspx. Until this fix, the logic in the events_edit.aspx page would fall through to the "Case Else" and land you at the event_edit instead of "removing" the event
and redirecting you back to events_list.aspx.
Below is the sub that the "action" value is passed to:
Protected
Sub Page_Load(ByVal sender As Object, ByVal e As System.EventArgs)
If Not IsPostBack Then
'Initialize the fields
Dim action As Object = Request.QueryString("Action")
If Not action Is Nothing Then
Select Case LCase(CStr(action))
case "new"
'We are in new mode
FormView1.ChangeMode(FormViewMode.Insert)
Dim lp As LocationsPicker = CType(FormView1.FindControl("LocationPicker1"), LocationsPicker)
lp.LocationID = Nothing
Dim dp As DurationPicker = CType(FormView1.FindControl("dtpicker"), DurationPicker)
dp.startDateTime = Now
dp.endDateTime = Now.AddHours(3)
Dim slp As TextBox = CType(FormView1.FindControl("staticURLTextBox"), TextBox)
slp.Enabled = False
Case
"delete"
SqlDataSource1.Delete() /* This was origionally "Remove" and I changed to "Delete"
Response.Redirect("Events_list.aspx")
Case Else
'We are in edit mode
Dim cb As CheckBox = CType(FormView1.FindControl("CheckBox1"), CheckBox)
Dim surl As TextBox = CType(FormView1.FindControl("staticURLTextBox"), TextBox)
If Not surl.Text Is Nothing AndAlso surl.Text <> "" Then
cb.Checked = True
surl.Enabled = True
Else
surl.Enabled = False
End If
End Select
End If
End If
End Sub
junck --
All human actions have one or more of these seven causes: chance, nature, compulsion, habit, reason, passion, and desire.
Aristotle Greek critic, philosopher, physicist(384 BC - 322 BC)
junck
Member
60 Points
12 Posts
Re: Identified bugs and fixes for the ClubSite Starter kit
Jun 26, 2006 12:03 AM|LINK
I found a bug in the events_list.aspx page.
I apologize if this bug has already been covered. I looked through the posts and could not find any threads about it so I decided to post what I discovered. Hope this helps.
To simulate:
1. log in as admin
2. navigate to events_list
3. click "List View"
4. click the green rollover button "Remove"
5. you are redirected to Events_Edit.aspx
6. The event is not removed.
Fix:
Under Begin News Item comment, under <asp:repeater...>, within <ItemTemplate>, and within <asp:panel ID=panel2...>, the line
"<Club:RolloverLink ID="RemoveBtn" runat="server" Text="Remove" NavigateURL='<%# "Events_Edit.aspx?Action=Remove&id=" & cstr(Eval("id")) %>'/>"
should be changed to read
<Club:RolloverLink ID="RemoveBtn" runat="server" Text="Remove" NavigateURL='<%# "Events_Edit.aspx?Action=delete&id=" & cstr(Eval("id")) %>'/>
This fix passes the correct parameter value to "action" that is defined in the events_edit.aspx. Until this fix, the logic in the events_edit.aspx page would fall through to the "Case Else" and land you at the event_edit instead of "removing" the event and redirecting you back to events_list.aspx.
Below is the sub that the "action" value is passed to:
Protected
Sub Page_Load(ByVal sender As Object, ByVal e As System.EventArgs)If Not IsPostBack Then
'Initialize the fields
Dim action As Object = Request.QueryString("Action")
If Not action Is Nothing Then
Select Case LCase(CStr(action))
case "new"
'We are in new mode
FormView1.ChangeMode(FormViewMode.Insert)
Dim lp As LocationsPicker = CType(FormView1.FindControl("LocationPicker1"), LocationsPicker)
lp.LocationID = Nothing
Dim dp As DurationPicker = CType(FormView1.FindControl("dtpicker"), DurationPicker)
dp.startDateTime = Now
dp.endDateTime = Now.AddHours(3)
Dim slp As TextBox = CType(FormView1.FindControl("staticURLTextBox"), TextBox)
slp.Enabled = False
Case "delete"
SqlDataSource1.Delete() /* This was origionally "Remove" and I changed to "Delete"
Response.Redirect("Events_list.aspx")
Case Else
'We are in edit mode
Dim cb As CheckBox = CType(FormView1.FindControl("CheckBox1"), CheckBox)
Dim surl As TextBox = CType(FormView1.FindControl("staticURLTextBox"), TextBox)
If Not surl.Text Is Nothing AndAlso surl.Text <> "" Then
cb.Checked = True
surl.Enabled = True
Else
surl.Enabled = False
End If
End Select
End If
End If
End Sub
All human actions have one or more of these seven causes: chance, nature, compulsion, habit, reason, passion, and desire.
Aristotle Greek critic, philosopher, physicist(384 BC - 322 BC)