PRB: ????????? ASP.NET ????? Change ??? ??? ?? ??? ?????? ???? ???? ??????

?????? ????????? ?????? ?????????
???? ???????: 314809 - ??? ???????? ???? ????? ????? ??? ???????.
????? ???? | ?? ????

?? ??? ??????

???????

??? ???? ????? ????????? ASP.NET ????? ??? ??? ASP.NET ?????? ??? ??? ?? ??? ?????? ???? ??????.

?????

????? ??? ????? ???? ??? ????? SelectedIndexChanged ?? ???? ???? DropDownList ?? ????? TextChanged ?? ???? ???? ???? ?? ??? ????? ????? Change ???????? ????? ?????. ????? ??? ??????? ??? ????? ????? ?????? ??? ???? ???? ??? ??? ?????.

????? ???? ASP.NET ??? ???????? ?????? ? ?? ????? ????? ?????? ???? ?? ??????? ???? ???? ??? ????? ??????. ??? ????? ?? ??? ???????? ASP.NET ?? ???? ???? ?????. ???? ??? "??? ???? ??????".

??? ??? ?????? ??? ???? ???? ??? ??? ??????? ????? ????? ????? ASP.NET ???? ???? ?? ???? ??. ??? ???????? ??? ????? Change ??? ??? ?? ??? ????? ???? ??????.

????

???? ?? ??? ????? Change ?????? ???? ?? ?????? ???? ???? ??? ASP.NET ???? ??????. ???? ??? ???? ????? ????? ????? ??????.

?????

????? ??? ?????? ??? ???????.

??????? ????

????? ????? ????? ?? ????

????? ????? ???

  1. ????? ????? ASP.NET Visual Basic ???? ???? ChangeFired.
  2. ???? WebForm1 ?? ??? ??????. ???? ???? ???? DataList ???? ???? ?? ??????? DataSet ??? ???????.
  3. ?? ???? ?????? ????? DataSet ???? ??? ?????? ?????? ???? ?? ???? ??? ?????. ???????? ?????? ????????? ????? ????? ??????.
  4. ????? ?????? ????? DataSet1. ????? ???? ???? ???? ????1.
  5. ????? ?????? Columns ????1. ????? ???? ???? ???? Column1.
  6. ???? ??? DataList1 ?? ?? ?????? ??????? DataSource ??? DataSet1.
  7. ???? ??? ?????? ?????? ??? DataList1 ???? ??? ????? ?????? ?? ?? ???? ??? ????? ??????. ?? ???? ???? ???? DropDownList ??? ?????? ItemTemplate.
  8. ???? ??? DropDownList1 ?? ?? ?????? ????? ???? ??? ?????? ???????. ????? ?? "?" ????? "??????" ?? ??? ??????? ??? ???????? ? ????? ? ????? ? ??? ??? ???????.
  9. ????? ??????? AutoPostBack ??? true DropDownList1.
  10. ????? ?????? DataBindings DropDownList1. ????? ????? ????? ?????? ?????? ??? ??????? SelectedIndex:
    DataBinder.Eval(Container, "DataItem.Column1")
    					
  11. ??????? ??? ????? ??? HTML. ????? ??? ?????? ??? true ?? ????? ?????? @ ??? ???:
    <%@ Page Language="vb" AutoEventWireup="false" Codebehind="WebForm1.aspx.vb" 
    Inherits="ChangeFired.WebForm1" trace="true" %>
    					

????? ??? ??? ???????

  1. ???? ??? ?????? ?????? ??? WebForm1.aspx ??? ?? ???? ??? ??? ????????? ????????.
  2. ?? ?????? ????????? ???????? ??????? ??? ????? Page_Load:
    DataSet1.Tables(0).Rows.Add(New Object() {"1"})
    DataSet1.Tables(0).Rows.Add(New Object() {"2"})
    DataSet1.Tables(0).Rows.Add(New Object() {"3"})
    DataSet1.Tables(0).Rows.Add(New Object() {"4"})
    
    If Not IsPostBack Then
      DataBind()
    End If
    
    Dim objItem As DataListItem
    For Each objItem In DataList1.Items
      AddHandler CType(objItem.FindControl("DropDownList1"), _
      DropDownList).SelectedIndexChanged, AddressOf DropDownList1_SelectedIndexChanged
      If Not objItem.FindControl("DropDownList1") Is Nothing Then
        Trace.Write("Added SelectedIndexChanged Handler")
      End If
    Next
    					
  3. ????? ????? Sub ???? ???? ????? Page_Load ??????? ??? SelectedIndexChanged ??? ???:
    Private Sub DropDownList1_SelectedIndexChanged(ByVal sender As System.Object, _
    ByVal e As System.EventArgs)
      DataBind()
      Trace.Write("SelectedIndexChanged, DataBind()")
    
      'Uncomment the following code to resolve this problem.
      'Dim objItem As DataListItem
      'For Each objItem In DataList1.Items
      '  AddHandler CType(objItem.FindControl("DropDownList1"), _
      '  DropDownList).SelectedIndexChanged, AddressOf DropDownList1_SelectedIndexChanged
      'Next
    End Sub
    					

????? ?? ?????

  1. ????? ??????. ???? ?? ????? ????? DropDownList ?? ?????? ???? ???? ????? ????? ?? ??????? ?????? ???? ??????.

    ???? ??? ??? ??????? ??????? DataBind ?????????? ?????? ????? ???? DropDownList ??? ????? ??????? ??? ??????? DataBind ?? ????? Page_Load. ???? ???? ????? ?????? ????? ?????? ??? ???? ?????? ?? ????.
  2. ???? ??? ???? ??? ??????. ???? ??? ???? ????? ??? ??? ???? ??? ????? ????????? ???????? ??? ???? ????? Page_Load. ???? ????? ?????? ?????? ???? DropDownList ??? ????? ????? ???????? ????? ??????.
  3. ????? ?????? ?? ??? ????? ???? DropDownList. ???? ?? ???? ????? ??? ??? ????. ???????? ??? ???? ???? ??? ????? Page_Load ?????? ????? DropDownList1_SelectedIndexChanged ASP.NET.
  4. ?? ????? DropDownList1_SelectedIndexChanged ??????? ??????? DataBind ??? ???? ?????? ????? ???? DropDownList ?????.

    ???? ?? ??? ??? ????? SelectedIndexChanged ??? ????? ?????? DropDownList ??? ? ?????? "?????? ???? ???" ASP.NET ? ?? ???? ???? ????? ?????? ???? DropDownList ????.
  5. ?????? ??????? ?????? ???? ??????. ???? ?? ????? ?????? DropDownList ?? ???? ??? ????? ?????.
  6. ???? ??? ???? ??? ??????. ???? ?? ???? ????? ????? ??? ????, ? ????? ?? ???? ASP.NET ????? Page_Load. ???? ????? ??? ????? SelectedIndexChanged ??? ????? ?????? DropDownList ????? ASP.NET ????? ????? ?? ??? ??????? ?? ????? ??????.

    ??? ???? ???? ???? ????? ????? ASP.NET ??? ????? SelectedIndexChanged ?????? ?? ????? ????.

?????

??? ??? ???????? uncomment ????????? ???????? ???????? ?? ????? DropDownList1_SelectedIndexChanged ???? ??????? ??????? ??? ?? ????? ???? ?? ?????? ??????.

???????

???? ???????: 314809 - ????? ??? ??????: 14/???? ?????/1425 - ??????: 2.7
????? ???
  • Microsoft ASP.NET 1.1
  • Microsoft ASP.NET 1.0
????? ??????: 
kbmt kbdatabinding kbevent kbprb kbservercontrols kbstate kbwebforms KB314809 KbMtar
????? ????
???: ??? ????? ??? ?????? ???????? ?????? ????? ???? ????? ?????????? ????? ?? ????????? ?????? ????. ???? ???? ?????????? ???? ?? ???????? ???????? ?????? ????????? ????? ????????? ???????? ????? ???????? ?????? ?? ?????? ??? ?? ???????? ???????? ?? ????? ??????? ?????? ??? ??????? ?????? ??. ?????? ?? ???? ??? ??????? ???????? ????? ?? ???? ????? ?????? ??? ????? ??? ????? ??????? ?? ????? ?? ?????? ??? ??? ??????? ??????? ?? ????? ????? ????? ????? ?????. ?? ????? ???? ?????????? ??????? ??? ????? ?? ??????? ?? ????? ?????? ?? ??? ????? ?? ????? ??????? ?? ???????? ?? ??? ???????. ???? ???? ?????????? ???????? ??? ????? ?????? ??????? ??????
???? ??? ????? ??????? ?????? ??????????314809

????? ???????

 

Contact us for more help

Contact us for more help
Connect with Answer Desk for expert help.
Get more support from smallbusiness.support.microsoft.com