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

HomeHomeArchived Discus...Archived Discus...Developing Under Previous Versions of .NETDeveloping Under Previous Versions of .NETASP.Net 2.0ASP.Net 2.0Module edit control never receives ItemIDModule edit control never receives ItemID
Previous
 
Next
New Post
2/2/2006 3:24 PM
 
I've got a custom module that is more or less operational in view mode.  However, I'm having problems editing the module parameters. 

The auto-generated (from the starter kit) code included an action for "AddContent".  Clicking this hyperlink will display the module's edit control, and results in a new instance of my module being created.  I'm having a beast of a time trying to figure out how to edit the parameters of an existing module instance.

I've tried adding a hyperlink to EditURL within the body of the view control, as seen in numerous examples, but that results in the dreaded Min/Max cookie error (not sure why).

I've also tried adding a second action for "EditContent", which does add the new option to the drop menu, but also results in a new instance being generated.

The base cause appears to be that the edit control isn't receiving an ItemID, and therefore is creating a new module instance every time.

Anybody have some ideas?
 
New Post
2/2/2006 5:23 PM
 

I had a bear of a time figuring out how to get my first custom module to work.  And it was the Edit page I had the problems with.

You may have to delete and start over, can't tell you about that.  Still too new at it.

However, that said, the starter kit builds two sql script files as part of the module definition.  You have to run both of them.  One creates the default database table and stored procedure, the other registers the module.  My problem was that I hadn't run the "register the module" script.  (I'm at work, not at home, or I would tell you the exact name of the script file to run.  It has SqlDataProvider in the name if I remember correctly.)

This solved the problem of the Edit and Add Content commands just showing me a blank window.

Second, there is a bug in the two default "Get" stored procedures the starter kit produces.  The bug shows up if you have set the security model for your module such that unregistered users can enter data into the module (which I did so I wouldn't have to log in over and over to test it!).  The module won't show the data even though it's in the database.  You have to change the generated SQL select statement to say "left outer join" instead of "inner join".

I haven't tested (yet!) what happens if a registered user is removed from the system.  But I suspect the bug would also keep data records entered by deleted users from showing up anymore. 

Hope that helps!

 
New Post
2/3/2006 10:35 AM
 
All the database scripts have been correctly (I believe) modified. The module has been successfully installed, and appears as an available module at the top of the admin page.

I can add the module to the page just fine. And I can open the edit control/page, which does indeed display correctly. The problem is that when I click the update link, it will always generate a new record in my module table, instead of updating the existing record.

In spite of all my attempts, the ItemID is always -1, and therefore the edit control/page bypasses the code that would update the existing record.

I need to know the correct procedure for creating an edit link that will pass the ItemID to the edit page. The procedure shown in several documents, and as used by the Events module, is to add the following to the view control/page:



When I try this, I recieve the following error: "MinMax persistance type of cookie requires a ModuleId". Any attempt to reference the EditURL method from the view control will generate this error. Even if I replace the call to DataBinder.Eval with an empty string.

I've also attempted to add the following code to the ModuleActions property of the view control:

Actions.Add(this.GetNextActionID(), "Edit PhotoBanner", ModuleActionType.EditContent, "Edit", "", this.EditUrl(), false, SecurityAccessLevel.Edit, true, false);

This results in a new "Edit PhotoBanner" option appearing in the module drop down menu, but the edit control/page still doesn't recieve the ItemID on the querystring. Therefore, its function is to add a new module instance, instead of editing the existing instance.

I hope this clarifies the nature of the problem.

Thanks.
 
New Post
2/6/2006 1:53 PM
 

You need to pass the ItemID of the record to be edited in the EditUrl function.

Typical use in hyperlink control's NavigateURL databinding expression in DataGrid, GridView controls, etc.:

     NavigateUrl='<%# EditURL("ItemID",DataBinder.Eval(Container.DataItem,"ItemID")) %>'

Typical use in Actions.Add:

     EditUrl("ItemID", ItemID.ToString), True)

Bill, WESNet Designs
Team Lead - DotNetNuke Gallery Module Project (Not Actively Being Developed)
Extensions Forge Projects . . .
Current: UserExport, ContentDeJour, ePrayer, DNN NewsTicker, By Invitation
Coming Soon: FRBO-For Rent By Owner
 
New Post
2/7/2006 10:32 AM
 
I tried a hyperlink with the NavigateURL set to EditURL (that info was cut from my previous post). Any attempt to call EditURL from the ascx page causes a "A critical error has occurred. MinMax persistance type of cookie requires a ModuleId" error to be thrown.

At your suggestion, I tried using the Actions.Add varient and realized that the ModuleActions property on the view page doesn't have any reference to an individual ItemID, as the view page may be showing multiple modules. The only place that the ItemID is accessible on the view page is within the page load, as the module collection is being enumerated.

I altered the page so that the Actions array isn't reset every time the ModuleActions property is called. I then put the call to Action.Add inside of the module enumeration (in PageLoad) so that it could properly set the ItemID argument. Once again I get the "MinMax persistance type of cookie requires a ModuleId" error.
 
Previous
 
Next
HomeHomeArchived Discus...Archived Discus...Developing Under Previous Versions of .NETDeveloping Under Previous Versions of .NETASP.Net 2.0ASP.Net 2.0Module edit control never receives ItemIDModule edit control never receives ItemID


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