Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations bkrike on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

DataList - How to start page in edit mode?

Status
Not open for further replies.

ietprofessional

Programmer
Apr 1, 2004
267
US
Hello Everyone,

I'm using a datalist on a form. I'm comfortable using a datalist as a editing tool, by using the itemtemplate and edittemplate. The user could go to an item click a button (with editcommand) that executes the edit command and the datalist goes to the edittemplate allowing the user to edit data:

Code:
Private Sub dlMember_EditCommand(ByVal source As Object, ByVal e As System.Web.UI.WebControls.DataListCommandEventArgs) Handles dlMember.EditCommand
  dlMember.EditItemIndex = e.Item.ItemIndex
  fillDataList()
End Sub

What I want to do is start the page in edit mode\display the edittemplate and when the user clicks the add button it would display the itemtemplate.

My problem is how do I get the object and datalistcommandeventargs passed to the dlMember_EditCommand function on pageload?

Thanks!
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top