Right, I see (partially; I am still not sure what kind of app you're building. I tend to find "Either way, choose the device type. if the device type is a pc, it redirects to pc.aspx. now if the pc dataset has a record, it will show the details. if it hasn't got anything it will just show the ID created previously." to be quite abstract. But that doesn't really matter).
There may be other ways to do this with the Dreamweaver server behaviors, but personally, I think I'd go for a custom solution.
Here's what you should do:
1. Create a new ASPX page
2. In Page_Load, retrieve the PC based on the incoming ID parameter.
3. Try to retrieve the associated record (at least, that's how I understand it is supposed to work). If it exists, save that record's ID to a hidden field in the page, and prepopulate the controls with the record's values. If it doesn't exist leave the hidden ID empty, and display empty controls.
4. In the click event of the Save button, look at the hidden ID field. If it's empty, perform an Insert, otherwise perform an Update against your datasource.
By dropping the DW behaviors, you have full control over what you're doing. It may be a bit more work at first, but I am convinced you'll end up with a page that is much easier to extend and maintain.
Cheers,
Imar
---------------------------------------
Imar Spaanjaars
Everyone is unique, except for me.
|