Hi Fredrik,
I know the reply is late and may be you have already solved the issue, but I hope this can help others.
I was also having an issue with this part of module, I used it on DNN community edition 6.2.3. When ever I was clicking on edit for any task, I was getting this error message:
"Corrupted Content Error".
After debugging the code I found out that the URL generating through EditUrl was including show("then URL")
Something like this:
" Show("dnndev/TaskManager.aspx .......")"
So I changed the code a little bit and it worked for me. Here are the changes:
in "View.ascx":
<asp:Repeater ID="rptTaskList" runat="server"
onitemcommand="rptTaskList_ItemCommand"
onitemdatabound="rptTaskList_ItemDataBound">
<ItemTemplate>
<li class="tm_t">
<h3>
<asp:Label ID="lblTaskName" runat="server" Text='<%# Eval("TaskName") %>'></asp:Label>
</h3>
<asp:Label ID="lblTargetCompletionDate" runat="server" Text='<%# Eval("TargetCompletionDate") %>' CssClass="tm_tcd"></asp:Label>
<asp:Label ID="lblTaskDescription" runat="server" Text='<%# Eval("TaskDescription") %>' CssClass="tm_td"></asp:Label>
<asp:Panel ID="pnlAdmin" runat="server" Visible="false">
<asp:LinkButton ID="lnkEdit" runat="server" ResourceKey="EditTask.Text" Visible="false" Enabled="false"></asp:LinkButton>
<asp:LinkButton ID="lnkDelete" runat="server" ResourceKey="DeleteTask.Text" CommandName="Delete" Visible="false" Enabled="false"></asp:LinkButton>
</asp:Panel>
</li>
</ItemTemplate>
</asp:Repeater>
in "View.ascx.cs"
protected void rptTaskList_ItemDataBound(object sender, System.Web.UI.WebControls.RepeaterItemEventArgs e)
{
if (e.Item.ItemType == ListItemType.AlternatingItem || e.Item.ItemType == ListItemType.Item)
{
LinkButton lnkEdit = (LinkButton)e.Item.FindControl("lnkEdit");
LinkButton lnkDelete = (LinkButton)e.Item.FindControl("lnkDelete");
Panel pnlAdminControls = (Panel)e.Item.FindControl("pnlAdmin");
Task curTask = (Task)e.Item.DataItem;
if (IsEditable && lnkDelete != null && lnkEdit != null && pnlAdminControls != null)
{
pnlAdminControls.Visible = true;
lnkDelete.CommandArgument = lnkEdit.CommandArgument = curTask.TaskId.ToString();
lnkEdit.PostBackUrl = (EditUrl(string.Empty, string.Empty, "Edit", "tid/" + curTask.TaskId.ToString())).ToString();
lnkDelete.Enabled = lnkDelete.Visible = lnkEdit.Enabled = lnkEdit.Visible = true;
}
else
{
pnlAdminControls.Visible = false;
}
ClientAPI.AddButtonConfirm(lnkDelete, Localization.GetString("ConfirmDelete", LocalResourceFile));
}
}
protected void rptTaskList_ItemCommand(object source, System.Web.UI.WebControls.RepeaterCommandEventArgs e)
{
if (e.CommandName == "Delete")
{
TaskController.DeleteTask(Convert.ToInt32(e.CommandArgument));
}
Response.Redirect(DotNetNuke.Common.Globals.NavigateURL());
}
Above code worked for me.
But there was a strange thing, source package was generating error. So I downloaded install package from codeplex and installed it on my website, it worked without any issue. I still don't get it, why install package was working but source package was not.
The issue was also posted on codeplex by someone:
http://dnntaskmanager.codeplex.com/wo...
If anyone get the reason then please also reply me :)
Regards,
NMathur