![]() | |
![]() |
| | Thread Tools | Search this Thread | Display Modes |
#1
| |||
| |||
|
#2
| |||
| |||
|
|
Hi, I have a problem with postback. When the page is postbacked, i want the second dropdownlist to be visible if the selectedvalue of the first one ="y". With this code, it remains invisible. What do i wrong here? Thanks David asp ropDownList ID="DropDownList1" runat="server" AutoPostBack=trueasp:ListItem>x</asp:ListItem asp:ListItem>y</asp:ListItem /asp ropDownListbr /> <br / asp ropDownList ID="DropDownList2" runat="server"AutoPostBack=true Visible=false asp:ListItem>1</asp:ListItem asp:ListItem>2</asp:ListItem /asp ropDownListProtected Sub Page_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Load If Page.IsPostBack Then If DropDownList1.SelectedValue = "y" Then DropDownList2.Visible = True End if End If End Sub |
#3
| |||
| |||
|
|
why not just put that logic in the SelectedIndexchanged event, making the 2nd ddl invisible by default.? David Wier http://aspnet101.com http://iWritePro.com - One click PDF, convert .doc/.rtf/.txt to HTML with no bloated markup "David" <no (AT) spam (DOT) rt> wrote in message news:eOgxSxLQIHA.6060 (AT) TK2MSFTNGP05 (DOT) phx.gbl... Hi, I have a problem with postback. When the page is postbacked, i want the second dropdownlist to be visible if the selectedvalue of the first one ="y". With this code, it remains invisible. What do i wrong here? Thanks David asp ropDownList ID="DropDownList1" runat="server" AutoPostBack=trueasp:ListItem>x</asp:ListItem asp:ListItem>y</asp:ListItem /asp ropDownListbr /> <br / asp ropDownList ID="DropDownList2" runat="server"AutoPostBack=true Visible=false asp:ListItem>1</asp:ListItem asp:ListItem>2</asp:ListItem /asp ropDownListProtected Sub Page_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Load If Page.IsPostBack Then If DropDownList1.SelectedValue = "y" Then DropDownList2.Visible = True End if End If End Sub |
#4
| |||
| |||
|
|
Thanks for replying. I tried the code within this: Protected Sub DropDownList1_SelectedIndexChanged(ByVal sender As Object, ByVal e As System.EventArgs) Handles DropDownList1.SelectedIndexChanged ... End Sub but ddl2 still invisible. I don't understand why the Page.IsPostBack doesn't work ... "David Wier" <dw (AT) dw (DOT) com> schreef in bericht news:edEwc%23LQIHA.2000 (AT) TK2MSFTNGP05 (DOT) phx.gbl... why not just put that logic in the SelectedIndexchanged event, making the 2nd ddl invisible by default.? David Wier http://aspnet101.com http://iWritePro.com - One click PDF, convert .doc/.rtf/.txt to HTML with no bloated markup "David" <no (AT) spam (DOT) rt> wrote in message news:eOgxSxLQIHA.6060 (AT) TK2MSFTNGP05 (DOT) phx.gbl... Hi, I have a problem with postback. When the page is postbacked, i want the second dropdownlist to be visible if the selectedvalue of the first one ="y". With this code, it remains invisible. What do i wrong here? Thanks David asp ropDownList ID="DropDownList1" runat="server" AutoPostBack=trueasp:ListItem>x</asp:ListItem asp:ListItem>y</asp:ListItem /asp ropDownListbr /> <br / asp ropDownList ID="DropDownList2" runat="server"AutoPostBack=true Visible=false asp:ListItem>1</asp:ListItem asp:ListItem>2</asp:ListItem /asp ropDownListProtected Sub Page_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Load If Page.IsPostBack Then If DropDownList1.SelectedValue = "y" Then DropDownList2.Visible = True End if End If End Sub |
#5
| |||
| |||
|
|
I just tried this: Protected Sub DropDownList1_SelectedIndexChanged(ByVal sender As Object, ByVal e As System.EventArgs) Handles DropDownList1.SelectedIndexChanged If DropDownList1.SelectedValue = "y" Then DropDownList2.Visible = "True" End Sub and it worked fine for me David Wier http://aspnet101.com http://iWritePro.com - One click PDF, convert .doc/.rtf/.txt to HTML with no bloated markup "David" <no (AT) spam (DOT) rt> wrote in message news:eVlsIIMQIHA.6036 (AT) TK2MSFTNGP03 (DOT) phx.gbl... Thanks for replying. I tried the code within this: Protected Sub DropDownList1_SelectedIndexChanged(ByVal sender As Object, ByVal e As System.EventArgs) Handles DropDownList1.SelectedIndexChanged ... End Sub but ddl2 still invisible. I don't understand why the Page.IsPostBack doesn't work ... "David Wier" <dw (AT) dw (DOT) com> schreef in bericht news:edEwc%23LQIHA.2000 (AT) TK2MSFTNGP05 (DOT) phx.gbl... why not just put that logic in the SelectedIndexchanged event, making the 2nd ddl invisible by default.? David Wier http://aspnet101.com http://iWritePro.com - One click PDF, convert .doc/.rtf/.txt to HTML with no bloated markup "David" <no (AT) spam (DOT) rt> wrote in message news:eOgxSxLQIHA.6060 (AT) TK2MSFTNGP05 (DOT) phx.gbl... Hi, I have a problem with postback. When the page is postbacked, i want the second dropdownlist to be visible if the selectedvalue of the first one ="y". With this code, it remains invisible. What do i wrong here? Thanks David asp ropDownList ID="DropDownList1" runat="server" AutoPostBack=trueasp:ListItem>x</asp:ListItem asp:ListItem>y</asp:ListItem /asp ropDownListbr /> <br / asp ropDownList ID="DropDownList2" runat="server"AutoPostBack=true Visible=false asp:ListItem>1</asp:ListItem asp:ListItem>2</asp:ListItem /asp ropDownListProtected Sub Page_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Load If Page.IsPostBack Then If DropDownList1.SelectedValue = "y" Then DropDownList2.Visible = True End if End If End Sub |
#6
| |||
| |||
|
|
I just tried this: Protected Sub DropDownList1_SelectedIndexChanged(ByVal sender As Object, ByVal e As System.EventArgs) Handles DropDownList1.SelectedIndexChanged If DropDownList1.SelectedValue = "y" Then DropDownList2.Visible = "True" End Sub and it worked fine for me David Wier http://aspnet101.com http://iWritePro.com - One click PDF, convert .doc/.rtf/.txt to HTML with no bloated markup "David" <no (AT) spam (DOT) rt> wrote in message news:eVlsIIMQIHA.6036 (AT) TK2MSFTNGP03 (DOT) phx.gbl... Thanks for replying. I tried the code within this: Protected Sub DropDownList1_SelectedIndexChanged(ByVal sender As Object, ByVal e As System.EventArgs) Handles DropDownList1.SelectedIndexChanged ... End Sub but ddl2 still invisible. I don't understand why the Page.IsPostBack doesn't work ... "David Wier" <dw (AT) dw (DOT) com> schreef in bericht news:edEwc%23LQIHA.2000 (AT) TK2MSFTNGP05 (DOT) phx.gbl... why not just put that logic in the SelectedIndexchanged event, making the 2nd ddl invisible by default.? David Wier http://aspnet101.com http://iWritePro.com - One click PDF, convert .doc/.rtf/.txt to HTML with no bloated markup "David" <no (AT) spam (DOT) rt> wrote in message news:eOgxSxLQIHA.6060 (AT) TK2MSFTNGP05 (DOT) phx.gbl... Hi, I have a problem with postback. When the page is postbacked, i want the second dropdownlist to be visible if the selectedvalue of the first one ="y". With this code, it remains invisible. What do i wrong here? Thanks David asp ropDownList ID="DropDownList1" runat="server" AutoPostBack=trueasp:ListItem>x</asp:ListItem asp:ListItem>y</asp:ListItem /asp ropDownListbr /> <br / asp ropDownList ID="DropDownList2" runat="server"AutoPostBack=true Visible=false asp:ListItem>1</asp:ListItem asp:ListItem>2</asp:ListItem /asp ropDownListProtected Sub Page_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Load If Page.IsPostBack Then If DropDownList1.SelectedValue = "y" Then DropDownList2.Visible = True End if End If End Sub |
#7
| |||
| |||
|
|
I just tried this: Protected Sub DropDownList1_SelectedIndexChanged(ByVal sender As Object, ByVal e As System.EventArgs) Handles DropDownList1.SelectedIndexChanged If DropDownList1.SelectedValue = "y" Then DropDownList2.Visible = "True" End Sub and it worked fine for me David Wier http://aspnet101.com http://iWritePro.com - One click PDF, convert .doc/.rtf/.txt to HTML with no bloated markup "David" <no (AT) spam (DOT) rt> wrote in message news:eVlsIIMQIHA.6036 (AT) TK2MSFTNGP03 (DOT) phx.gbl... Thanks for replying. I tried the code within this: Protected Sub DropDownList1_SelectedIndexChanged(ByVal sender As Object, ByVal e As System.EventArgs) Handles DropDownList1.SelectedIndexChanged ... End Sub but ddl2 still invisible. I don't understand why the Page.IsPostBack doesn't work ... "David Wier" <dw (AT) dw (DOT) com> schreef in bericht news:edEwc%23LQIHA.2000 (AT) TK2MSFTNGP05 (DOT) phx.gbl... why not just put that logic in the SelectedIndexchanged event, making the 2nd ddl invisible by default.? David Wier http://aspnet101.com http://iWritePro.com - One click PDF, convert .doc/.rtf/.txt to HTML with no bloated markup "David" <no (AT) spam (DOT) rt> wrote in message news:eOgxSxLQIHA.6060 (AT) TK2MSFTNGP05 (DOT) phx.gbl... Hi, I have a problem with postback. When the page is postbacked, i want the second dropdownlist to be visible if the selectedvalue of the first one ="y". With this code, it remains invisible. What do i wrong here? Thanks David asp ropDownList ID="DropDownList1" runat="server" AutoPostBack=trueasp:ListItem>x</asp:ListItem asp:ListItem>y</asp:ListItem /asp ropDownListbr /> <br / asp ropDownList ID="DropDownList2" runat="server"AutoPostBack=true Visible=false asp:ListItem>1</asp:ListItem asp:ListItem>2</asp:ListItem /asp ropDownListProtected Sub Page_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Load If Page.IsPostBack Then If DropDownList1.SelectedValue = "y" Then DropDownList2.Visible = True End if End If End Sub |
![]() |
| Thread Tools | Search this Thread |
| Display Modes | |
| |