The below code is a start but it doesn't seem to be working:
Code Behind
<Script Runat="Server">
Sub Page_Load(Source As Object, E as EventArgs)
ScriptManager1.RegisterAsyncPostBackControl(ScriptManager1)
End Sub
Protected Sub DropDownList1_SelectedIndexChanged(ByVal sender As Object, ByVal e As System.EventArgs) Handles DropDownList1.SelectedIndexChanged
If DropDownList1.Text = "HyperLink" Then
Panel1.Visible = True
Else
Panel1.Visible = False
End If
End Sub
</Script>
Beware of bugs in the above code; I have only proved it correct, not tried it.
-------------------------------------------------------
Contact-Info:Adils.kiet@gmail.com
DropDownList AutoPostBack is set to "True" and is now inside UpdatePanel. The Panel is still not changing from Hidden to Visible OnSelectedIndexChanged.
Is the Panel inside of this UpdatePanel coded correctly?
I tried out your code and it works fine, even with the dropdownlist out of the update panel. The only thing I can think of is make sure that the text in your dropdownlist matches the code exactly - "HyperLink" and not "Hyperlink" or "hyperlink"
ARJ DESIGNS
Member
163 Points
139 Posts
How do I hide/show asp:Panel on asp:DropDownList OnSelectedIndexChanged?
Jan 10, 2013 11:20 PM|LINK
The below code is a start but it doesn't seem to be working:
Code Behind
Source Code
usman400
Contributor
3513 Points
721 Posts
Re: How do I hide/show asp:Panel on asp:DropDownList OnSelectedIndexChanged?
Jan 11, 2013 04:03 AM|LINK
Code seems alright
make sure that the drop downs autopostback property is set to true
Jugg3rNaut
Member
474 Points
109 Posts
Re: How do I hide/show asp:Panel on asp:DropDownList OnSelectedIndexChanged?
Jan 11, 2013 04:21 AM|LINK
Take DropDown Inside of your Update Panel
-------------------------------------------------------
Contact-Info:Adils.kiet@gmail.com
ManikandanUl...
Participant
850 Points
253 Posts
Re: How do I hide/show asp:Panel on asp:DropDownList OnSelectedIndexChanged?
Jan 11, 2013 04:45 AM|LINK
put dropdownlist inside the updatepanel.
Click "…Mark As Answer" if my reply helpful....
ARJ DESIGNS
Member
163 Points
139 Posts
Re: How do I hide/show asp:Panel on asp:DropDownList OnSelectedIndexChanged?
Jan 14, 2013 05:50 PM|LINK
DropDownList AutoPostBack is set to "True" and is now inside UpdatePanel. The Panel is still not changing from Hidden to Visible OnSelectedIndexChanged.
Is the Panel inside of this UpdatePanel coded correctly?
TheDirtyBird
Participant
806 Points
339 Posts
Re: How do I hide/show asp:Panel on asp:DropDownList OnSelectedIndexChanged?
Jan 14, 2013 05:56 PM|LINK
Comment out all the AJAX and see if it works.
ARJ DESIGNS
Member
163 Points
139 Posts
Re: How do I hide/show asp:Panel on asp:DropDownList OnSelectedIndexChanged?
Jan 14, 2013 06:10 PM|LINK
What do you mean? All of my code is in the original post.
msmk
Participant
776 Points
158 Posts
Re: How do I hide/show asp:Panel on asp:DropDownList OnSelectedIndexChanged?
Jan 14, 2013 06:41 PM|LINK
I tried out your code and it works fine, even with the dropdownlist out of the update panel. The only thing I can think of is make sure that the text in your dropdownlist matches the code exactly - "HyperLink" and not "Hyperlink" or "hyperlink"
ARJ DESIGNS
Member
163 Points
139 Posts
Re: How do I hide/show asp:Panel on asp:DropDownList OnSelectedIndexChanged?
Jan 14, 2013 07:18 PM|LINK
If I view the page in Internet Explorer, I get following error message appears:
ARJ DESIGNS
Member
163 Points
139 Posts
Re: How do I hide/show asp:Panel on asp:DropDownList OnSelectedIndexChanged?
Jan 14, 2013 07:47 PM|LINK
Is there anything that I need to do differently if I am using a Master Pager File?