C
Chuck
I hope someone can help me out. I am trying to create a simple page
with a drop down list that gives the user the ability to select which
url they would like to run. The url does call a javascript function
"openWin" that opens the browser to a specific size.
The problem is that everytime I select a value in the drop down list I
have to click the button twice to get the right url to open. The first
time always opens the wrong url.
Here's my code..
-------------------------------------------------------------------
Private Sub Page_Load(ByVal sender As System.Object, ByVal e As
System.EventArgs) Handles MyBase.Load
Select Case DropDownList1.SelectedValue
Case "0"
Button1.Attributes.Add("language", "javascript")
Button1.Attributes.Add("onClick",
"openWin('http://www.microsoft.com');return true;")
Case "1"
Button1.Attributes.Add("language", "javascript")
Button1.Attributes.Add("onClick",
"openWin('http://www.yahoo.com');return true;")
End Select
End Sub
---------------------------------------------------------------
<form id="Form1" method="post" runat="server">
<asp:dropdownlist id="DropDownList1" style="Z-INDEX: 101; LEFT:
160px; POSITION: absolute; TOP: 40px"
runat="server" Width="208px">
<asp:ListItem Value="0"
Selected="True">microsoft.com</asp:ListItem>
<asp:ListItem Value="1">yahoo.com</asp:ListItem>
</asp:dropdownlist>
<asp:Button id="Button1" runat="server" Text="Button"
CausesValidation="False"></asp:Button>
</form>
-------------------------------------------------------------------
with a drop down list that gives the user the ability to select which
url they would like to run. The url does call a javascript function
"openWin" that opens the browser to a specific size.
The problem is that everytime I select a value in the drop down list I
have to click the button twice to get the right url to open. The first
time always opens the wrong url.
Here's my code..
-------------------------------------------------------------------
Private Sub Page_Load(ByVal sender As System.Object, ByVal e As
System.EventArgs) Handles MyBase.Load
Select Case DropDownList1.SelectedValue
Case "0"
Button1.Attributes.Add("language", "javascript")
Button1.Attributes.Add("onClick",
"openWin('http://www.microsoft.com');return true;")
Case "1"
Button1.Attributes.Add("language", "javascript")
Button1.Attributes.Add("onClick",
"openWin('http://www.yahoo.com');return true;")
End Select
End Sub
---------------------------------------------------------------
<form id="Form1" method="post" runat="server">
<asp:dropdownlist id="DropDownList1" style="Z-INDEX: 101; LEFT:
160px; POSITION: absolute; TOP: 40px"
runat="server" Width="208px">
<asp:ListItem Value="0"
Selected="True">microsoft.com</asp:ListItem>
<asp:ListItem Value="1">yahoo.com</asp:ListItem>
</asp:dropdownlist>
<asp:Button id="Button1" runat="server" Text="Button"
CausesValidation="False"></asp:Button>
</form>
-------------------------------------------------------------------