code_junkie

SelectedIndexChanged event handler getting old index

Nov 10th, 2011
127
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.63 KB | None | 0 0
  1. <div style="margin: 0px; padding: 0px 1em 0px 0px;">
  2. <span style="margin: 0px; padding: 0px; vertical-align: top;">Route:</span>
  3. <asp:DropDownList id="Select1" runat="server" onselectedindexchanged="index_changed" AutoPostBack="true">
  4. </asp:DropDownList>
  5. <asp:Literal ID="Literal1" runat="server"></asp:Literal>
  6. </div>
  7.  
  8. protected void index_changed(object sender, EventArgs e)
  9. {
  10. decimal d = Convert.ToDecimal( Select1.SelectedValue );
  11. Literal1.Text = d.ToString();
  12. }
  13.  
  14. if (!IsCallback && !IsPostBack)
  15. {
  16. // Do your page setup here
  17. }
  18.  
  19. if(!IsPostback) d.SelectedValue = "Default"
Add Comment
Please, Sign In to add comment