I don't know what you're trying to do with the compare if(text==text1) since they will always be equal. You're comparing the same value every time. If you are trying to pass the selected value to a child window (or popup), try this:
Parent.aspx:
<form id="Form1" method="post" runat="server">
<asp:listbox id="ListBox1" ondblclick="openWindow(this)" runat="server">
<asp:listitem value="1">Item 1</asp:listitem>
<asp:listitem value="2">Item 2</asp:listitem>
<asp:listitem value="3">Item 3</asp:listitem>
<asp:listitem value="4">Item 4</asp:listitem>
<asp:listitem value="5">Item 5</asp:listitem>
<asp:listitem value="6">Item 6</asp:listitem>
</asp:listbox>
</form>
<script type="text/javascript">
<!--
function openWindow(elementRef)
{
var selectedIndex = elementRef.selectedIndex;
var selectedValue = elementRef.options[selectedIndex].text;
var windowUrl = 'Child.aspx?selectedValue=' + selectedValue;
var windowName = 'Window_' + new Date().getTime();
var windowFeatures =
'channelmode=no,directories=no,fullscreen=no,' +
'location=yes,dependent=yes,menubar=no,resizable=no,scrollbars=yes,' +
'status=no,toolbar=no,titlebar=no,' +
'left=0,top=0,width=500px,height=300px';
window.open(windowUrl, windowName, windowFeatures);
}
// -->
</script>
Child.aspx.cs:
private void Page_Load(object sender, System.EventArgs e)
{
string selectedValue = (this.Request["selectedValue"] == null) ? string.Empty : this.Request["selectedValue"];
this.Response.Write("selectedValue [" + selectedValue + "]<br>");
}
NC...