Howdy, I have a webform with a radscheduler (setup.aspx), code has the following javascript to intercept an appointment click and load additional data in a radwindow (setuppopup.aspx). Setuppopup.aspx executed/behaved perfectly fine when running on its own (i.e. not inside a radwindow). However, now, a dropdownlist isn't getting selected anymore, and a button that transfers values from a textbox to a listbox seems to duplicate all the values that it transfers.
In Setup.aspx:
<script type="text/javascript">
function ShowDetails(sender, eventArgs)
{
var id = eventArgs.get_appointment().ID;
var stringUrl = "SetupPopUp.aspx?ID=" + id;
var popup = radopen(stringUrl);
popup.setSize(800,750);
popup.Center();
}
</script>
<telerik:RadWindowManager ID="RadWindowManager1" runat="server">
</telerik:RadWindowManager>
In SetupPopUp.aspx.vb
Private Sub GrabSQLMeetingInfo(ByVal MDBid As Int32)
Dim Conn As New SqlConnection(ConStr)
Conn.Open()
Dim cmd As New SqlCommand("GetMeetingByID", Conn)
Dim reader As SqlDataReader = Nothing
Try
cmd.CommandType = Data.CommandType.StoredProcedure
cmd.Parameters.AddWithValue("@MDBid", MDBid)
reader = cmd.ExecuteReader(CommandBehavior.SingleRow)
If Not reader Is Nothing Then
While reader.Read
Session("MeetingID") = reader.GetInt32(0)
Dim meetcontact As String = reader.GetString(3)
lblPresenter.Text = meetcontact
For Each li As ListItem In ddlPresenter.Items
If li.Value = meetcontact Then
li.Selected = True
End If
Next
'grabs other data that shows up fine in labels
End While
Else
End If
Catch ex As Exception
Finally
cmd.Dispose()
Conn.Close()
End Try
End Sub
The button that is supposed to parse the textbox and spit out to a listbox does the following:
Private Sub FromStringToList(ByVal parsing As String)
If parsing.Length > 0 Then
Dim myArray() As String = Nothing
myArray = parsing.Split(Environment.NewLine)
Dim count As Integer = 0
For z As Integer = 0 To myArray.Length - 1 'last one is an empty place, so ignore it
Try
lbGuestsPending.Items.Add(Trim(myArray(z).ToString))
count = count + 1
Catch ex As Exception
End Try
uT.Color(lblNameAdded, Drawing.Color.Yellow, Drawing.Color.Green, "Added " & count & " name(s)")
Next
End If
End Sub
The button click seems to be occuring twice now.
Incidentally, the lbGuestPending has its values loaded in the reader referenced above, after the ddlpresenter control is supposed to have its value selected, without problems.
Please let me know what i'm missing.
Thank you in advance.