Results 1 to 2 of 2

Thread: Urgent VB.net datalist control items in edit template

Threaded View

  1. #1

    Thread Starter
    New Member
    Join Date
    Apr 2003
    Posts
    9

    Urgent VB.net datalist control items in edit template

    Hi guys,
    Im using vb.net and working with a datalist.

    I have labels, textboxes dropdownlist in the main item template.

    I also have labels, textboxes dropdownlist in the edit template

    which means when i click the edit button from the datalist list of records it brings me to another interface for editing.(where these textboxes etc will be displayed)

    Problem:

    Using

    DataList1.EditItemIndex = e.Item.ItemIndex
    CType(e.Item.FindControl("name_of_label"), Label).Text = objFAC_DES("FAC_DESC").ToString
    dont bother about objFAC_DES("FAC_DESC").ToString
    its a datareader... I ve checked all my sql query working perfectly in the code, somehow i can safely say that i've narrow down the problem to the datalist find control reference error.

    It cannot work:error says object reference is not set to instance

    This same code and method works for all the form elements in the main item template but not in the edit template.

    I've also tried the following:
    using page trace i manage to identify the ID of the form elements

    Dim myId As String = (CType(sender, DropDownList)).Parent.ClientID.ToString()
    where sender is the object passed into the edit function
    the id is something like "_clt0, _clt1"
    e.item.FindControl(myId).FindControl("lstDropDownList").text="Testing"
    I've checked my asp theres no nested form tags only one form

    I think it take more than a guru to solve this.
    Pls advice thanks.
    Last edited by evelin; Apr 30th, 2003 at 05:07 AM.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width