Capturing Server Controls Data FindControl

Last post 02-26-2005, 7:57 AM by intelogix. 0 replies.
Sort Posts: Previous Next
  •  02-26-2005, 7:57 AM 4293

    Capturing Server Controls Data FindControl

    How do you capture a Dropdown or Textbox selectedValue or text when it's dynamically added to the editor. I'm getting a "Invalid specified Cast" or "Object Reference to Nothing" when I use rcpReditor.findcontrol("ddlcat"). The add code is below and the get.

    'Add dropdown and bind it to datasource 

    Dim ddlCat AsNew System.Web.UI.WebControls.DropDownList

    ddlCat.ID = "ddlCat"

    ddlCat.DataSource = dt

    ddlCat.DataTextField = "CategoryTitle"

    ddlCat.DataValueField = "CategoryID"

    ddlCat.DataBind()

    rcpEditor.AddToolbarGroupStart()

    rcpEditor.AddToolControl("ddlCat", ddlCat)

    rcpEditor.AddToolbarGroupEnd()
     
    'Retrieve data on Postback

    PrivateSub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs)

    Dim i AsInteger

    For i = 0 To rcpEditor.ToolControls.Count - 1

    ddlCat = rcpEditor.ToolControls("ddlcat").Control

    Next
    EndSub
     
    'Produces error
     
     
    thanks,
     
    MU
View as RSS news feed in XML