Products

Solutions

Resources

Partners

Community

Blog

About

QA

Ideas Test

New Community Website

Ordinarily, you'd be at the right spot, but we've recently launched a brand new community website... For the community, by the community.

Yay... Take Me to the Community!

Welcome to the DNN Community Forums, your preferred source of online community support for all things related to DNN.
In order to participate you must be a registered DNNizen

HomeHomeDevelopment and...Development and...Building ExtensionsBuilding ExtensionsModulesModulesEditUrl not working?EditUrl not working?
Previous
 
Next
New Post
10/11/2012 12:01 PM
 

Hi,

I am learning how to develop modules in DotNetNuke and have been following the TaskManager video series. There was one thing that did not work in my installation of DotNetNuke, and that was the Edit of the TaskManager items. The code when you click the Edit button is:

Response.Redirect(EditUrl(string.Empty, string.Empty, "Edit", "tid=" + e.CommandArgument));

When Christ Hammond clicks the editbutton, he is redirected to the url http://dnndev/TaskManager/tabid/65/ct..., but when I run it I am redirected to http://dnndev/Test2.aspx, which is blank (the page where I put the TaskManager module on is called Test2).

Anyone who has a clue why it's not working? I am using version 6.2.

 
New Post
10/12/2012 1:25 AM
 
Have you added controls and code to the edit.aspx file in Visual Studio? And wired up the edit button? See videos 17,18,19 and 24.

Bill
 
New Post
10/12/2012 10:06 AM
 
Yes, I have done that, but the EditUrl seems to produce the wrong url or some error occur there.
 
New Post
10/12/2012 10:20 AM
 
please be aware, that module control keys are case sensitive.

Cheers from Germany,
Sebastian Leupold

dnnWerk - The DotNetNuke Experts   German Spoken DotNetNuke User Group

Speed up your DNN Websites with TurboDNN
 
New Post
10/15/2012 3:32 AM
 
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
 
Previous
 
Next
HomeHomeDevelopment and...Development and...Building ExtensionsBuilding ExtensionsModulesModulesEditUrl not working?EditUrl not working?


These Forums are dedicated to discussion of DNN Platform and Evoq Solutions.

For the benefit of the community and to protect the integrity of the ecosystem, please observe the following posting guidelines:

  1. No Advertising. This includes promotion of commercial and non-commercial products or services which are not directly related to DNN.
  2. No vendor trolling / poaching. If someone posts about a vendor issue, allow the vendor or other customers to respond. Any post that looks like trolling / poaching will be removed.
  3. Discussion or promotion of DNN Platform product releases under a different brand name are strictly prohibited.
  4. No Flaming or Trolling.
  5. No Profanity, Racism, or Prejudice.
  6. Site Moderators have the final word on approving / removing a thread or post or comment.
  7. English language posting only, please.
What is Liquid Content?
Find Out
What is Liquid Content?
Find Out
What is Liquid Content?
Find Out