Karthik K

Karthik K

  • 1.3k
  • 479
  • 50k

dropdown Validation on button with Postbackurl in button ?

Jun 21 2020 10:24 PM
Hi All ,
 
I my recent Project , I have situation to validate dropdwon control , when i click button click Like " Procedd " Button. There is postbackurl to redirect some other page. when tried to validate dropdown in Onclientclick of button.Mentioned redirection using postbackurl Property not working.
 
If anyone knows solution for this issue .suggest me with example .
 
Dropdown :
<asp:DropDownList ID="cmbBranches" runat="server" CssClass="mydropdownlist" AutoPostBack="true" OnSelectedIndexChanged="cmbBranches_SelectedIndexChanged"></asp:DropDownList>
 
button :
<asp:Button ID="btnStart" runat="server" Text="START" class="ButtonStart" PostBackUrl="~/Home.aspx" />
 
If user select , dropdown index - 0 i Have prompt Alert message , other than index - 0 , allow to homepage .
 
Thanks in advance
Karthik

Answers (1)