I can't get values from the drop-down menu.
The code:
<asp:DropDownList ID="DropDownList1" runat="server">
<asp:ListItem Value="value" Selected="False">
Available Captions
</asp:ListItem>
</asp:DropDownList
Dim lang As String = DropDownList1.SelectedValue
This cause to getting invaled url and getting a 400 error and xml exception
I can't track the error because the code works in some places.
The code works
here (a blank page with user control) and
here (user control inside an update panel)
But it doesn't work
here (user control inside an update panel) and I get "value" as value
(whene click red play arrow button to get youtube caption)
How I can fix or track this error
Based on your description and the link , I cannot reproduce your problem.
400 error means that bad request. the server cannot or will not process the request due to a significant client error (for example, a malformed request syntax, too large size, invalid request message, or spoofed routing request).
If you haven't solved the problem yet, please post you code that can reprodece your problem.
Best regards,
Sam
IIS.NET forums are moving to a new home on Microsoft Q&A, we encourage you to go to Microsoft Q&A for .NET for posting new questions and get involved today. Learn more >
None
0 Points
2 Posts
Cant get drop down list value
Aug 05, 2019 09:47 AM|Yusuf_A|LINK
Hi
I can't get values from the drop-down menu.
The code:
This cause to getting invaled url and getting a 400 error and xml exception
I can't track the error because the code works in some places.
The code works here (a blank page with user control) and here (user control inside an update panel)
But it doesn't work here (user control inside an update panel) and I get "value" as value
(whene click red play arrow button to get youtube caption)
How I can fix or track this error
Thank
Participant
860 Points
498 Posts
Re: Cant get drop down list value
Aug 05, 2019 10:29 AM|AddWeb Solution|LINK
Hello, Yusuf_A
You have to use selecteditem.value instead of selectedvalue
And Use IsPostback event also.
Refer Link :
https://stackoverflow.com/questions/12834190/why-cant-get-the-right-value-of-dropdownlist-in-asp-net
Thanks.
Contributor
3370 Points
1409 Posts
Re: Cant get drop down list value
Aug 06, 2019 03:04 AM|samwu|LINK
Hi Yusuf_A,
Based on your description and the link , I cannot reproduce your problem.
400 error means that bad request. the server cannot or will not process the request due to a significant client error (for example, a malformed request syntax, too large size, invalid request message, or spoofed routing request).
More information about 400 error you can refere to this link:https://airbrake.io/blog/http-errors/400-bad-request
If you haven't solved the problem yet, please post you code that can reprodece your problem.
Best regards,
Sam
None
0 Points
2 Posts
Re: Cant get drop down list value
Aug 06, 2019 11:45 AM|Yusuf_A|LINK
Thank you for your answer i fix the problem by enable view state
UserCtrl.EnableViewState = True;