asp.net Problem with Drop Down Box - TechRepublic
General discussion
January 19, 2004 at 12:37 PM
dejan_zivanovic

asp.net Problem with Drop Down Box

by dejan_zivanovic . Updated 22 years, 5 months ago

I have a Web Form with few controls such as textboxes and drop down boxes among others.
This Web Form calls my Search Web Form using client scripting executed from button_click event
(Response.Write(““))

When I get my results in search form, I post then to calling form using client scripting like this:

Public Sub DataGrid1_Item(ByVal sender As Object, ByVal e As DataGridCommandEventArgs)
If e.CommandName = “Select” Then
Dim sValue As String
sValue = “”

If InStr(control1.Value, “,”) > 0 Then
Dim con() As String
Dim i As Integer

con = Split(control1.Value, “,”)

For i = 0 To UBound(con)
If InStr(con(i), “ddl”) > 0 Then
sValue = sValue + “window.opener.document.forms[0].” + con(i) + “.options.selectedIndex = ” + Trim(GridTable1.Rows(e.Item.ItemIndex)(i + (CInt(ItemsDataSet.Tables(“TABLE1”).Rows(0).Item(“searchHIDE”)) – 1)).ToString()) + “;”
Else
sValue = sValue + “window.opener.document.forms[0].” + con(i) + “.value = ‘” + Trim(GridTable1.Rows(e.Item.ItemIndex)(i + (CInt(ItemsDataSet.Tables(“TABLE1”).Rows(0).Item(“searchHIDE”)) – 1)).ToString()) + “‘;”
End If
Next
Else
sValue = “window.opener.document.forms[0].” + control1.Value + “.value = ‘” + GridTable1.Rows(e.Item.ItemIndex)(1 + (CInt(ItemsDataSet.Tables(“TABLE1”).Rows(0).Item(“searchHIDE”)) – 1)).ToString() + “‘;”
End If

Dim strScript As String = “

This discussion is locked

All Comments