2010-04-16 2 views
0

페이지로드시 컨트롤 속성을 설정 중입니다. 로드 된 데이터에 따라 컨트롤의 가시성이 비슷합니다. 버튼 컨트롤까지 이미지를 설정하는 것은 매우 간단합니다. 페이지로드의 경우 제대로 작동하지만 포스트 백에서이 값은 다시 설정되지 않습니다. 이것은 내 코드입니다. 그것이 포스트 백일 때 btnSecurityQA 이미지가 없으며 그에 따라 모든 다음 컨트롤의 가시성이 설정되지 않습니다.포스트 백 사이에 컨트롤 속성을 설정하는 중 작동하지 않습니다.

If Not IsPostBack Then 
     ButtonImage.SetPath(btnSecurityQA, GetLocalResourceObject(btnSecurityQA.ID & "BaseName").ToString()) 

     ' following control's visibility is set by the view interface 
     Dim accountsPresenter = New AccountsPresenter 
     accountsPresenter.SetAccountVisibility(Me, m_Account) 
     chkMoneyMarket.Visible = _moneyMarketVisible 
     lblRoutingNumber.Visible = _routingNumberVisible 
     txtRoutingNumber.Visible = _routingNumberVisible 
     lblSubType.Visible = _loanSubTypeVisible 
     cboLoanSubType.Visible = _loanSubTypeVisible 
     If Not IsNothing(m_Account) Then 
      If m_Account.Id <> Guid.Empty Then 
       Call PopulateLoanAccountSubTypes() 
       Call PopulateData() 
      End If 
     End If 
    End If 

답변

0

당신은 단지 그것 때문에 내부에 있다는 사실에 페이지가로드 처음이 실행됩니다 게시 한 코드 조건문 "아니 IsPostBack을 그런 다음이". 이 코드는 다시 검사 할 때 다시 실행되지 않습니다.

+0

처음으로 할당 된 값을 다시 게시간에 저장하지 않아도됩니까? 매번 이러한 속성을 설정해야합니까? 나는 그것이 viewstate에서 저장할 것이라고 생각했다. 동적으로로드되지 않을 때 작동하는 방식이다.이 속성은 다른 페이지에 동적으로로드되는 사용자 컨트롤에 대해 설정되고로드 된 후에 부모 페이지에 대한 조회수를 저장한다. – user228777

+0

페이지에 대해 Viewstate를 사용 하시겠습니까? – bechbd

+0

페이지에서 켜기 – user228777

관련 문제