Login
Register
17-05-2008

Resources for the DotNetNuke Community
Join WebHost4Life.com
Support this site

  Support forums  

You need to be logged in in order to post to this forums.
SearchForum Home
  DotNetNuke Development  HelloWorld Tutorial  Qestion regardi...
 Qestion regarding ItemID
 
imgOfflinetradiate
1 posts
Joined
2/15/2006

Qestion regarding ItemID
Posted: 15 Feb 06 2:20 PM Modified By tradiate  on 2/15/2006 2:21:28 PM)

Using your templates I have created my own module.  Inside the xxxEdit.ascx.cs file, just inside the Page_Load method, there is code that looks like this:

if (!(Request.Params["ItemId"] == null)) {

    itemId = Int32.Parse(Request.Params["ItemId"]);

} else {

    itemId = Null.NullInteger;

}

My question is:  where is the ItemId parm supposed to be set?  When execution arrives in my edit control, the ItemId is never part of the Request.Params.  Because of this, when I enter a value for my textBox (the only string I save in my table besides the moduleID and itemID) the cmdUpdate_Click method will always call Add() since the ItemId is never present.

imgOfflinednnjungle
141 posts
5th
Joined
3/13/2005

Re: Qestion regarding ItemID
Posted: 24 Feb 06 12:11 AM

ItemId should be passed to the edit control from the view control. When you're viewing your list of items, you usually configure a way to go to the edit screen (via a link, button, ...). This link should carry the itemid to the edit screen so the current item can be retrieved from the db and correctly edited.

Take a look at any of the core modules or this code on the HelloWorld.ascx file:

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

 


Disgrafic.com
  DotNetNuke Development  HelloWorld Tutorial  Qestion regardi...
© Vicenç Masanas Terms Of Use Privacy Statement   
.