PostBack shfits Radwindow на page_load из динамически созданного RadWindow - PullRequest
0 голосов
/ 15 февраля 2019

Я динамически создаю RadWindow, и поэтому после его создания в этом RadWindow есть кнопка.Также есть флажок, который делает пост обратно.После того, как я нажму кнопку, Radwindow сохранит некоторые данные.но после поста назад и перезагрузки мое radwindow немного сдвигается вправо?

Parent Page

Private Sub btnAddSupervision_Click(ByVal sender As Object, ByVal e As System.EventArgs) Handles btnAddSupervision.Click
    getWindow("Add", False)
End Sub

Private Sub getWindow(Title As String, IncludeSupervision As Boolean)

    Dim PageUrl As String = "~/Supervision_Edit.aspx"

    Menuradwindow.Windows.Clear()
    Menuradwindow.VisibleOnPageLoad = False
    Dim newWindow As New RadWindow()
    newWindow.AutoSize = True
    newWindow.VisibleOnPageLoad = True
    newWindow.Modal = False
    newWindow.MaxWidth = 800


    Menuradwindow.Windows.Add(newWindow)
    newWindow.DestroyOnClose = True
    newWindow.BorderWidth = 1
    newWindow.Behaviors = WindowBehaviors.Default
    newWindow.BorderStyle = BorderStyle.None
    newWindow.VisibleStatusbar = False
    newWindow.Title = Title


    newWindow.NavigateUrl = PageUrl & "?SupervisionID=" & SupervisionID & "&StaffRosterID=" & StaffRosterID & "&ButtonID=" & Title

End Sub

ChildRadWindow Page

Private Sub Page_Init(sender As Object, e As EventArgs) Handles Me.Init


    ModalButton1.Visible = False
    ModalButton2.Visible = False
    ModalButton3.Visible = False
    ModalButton4.Visible = False
    ModalButton5.Visible = False


    ButtonTextID = (Request.QueryString("ButtonID")).ToString


    If Not ButtonTextID = _Add Then
        currSupervisionID = (Request.QueryString("SupervisionID"))
        currStaffRosterID = (Request.QueryString("StaffRosterID"))
    End If

    'view data, to create dynamic controls
    If ButtonTextID = _Add Then
        PopulateCheckBox("[spGet_Supervision_SupervisedStaff]")
        BuildQuestionControl(pnlQuestionsForSupervisor, "[spGet_Supervision_QuestionsForSupervisor]")
        pnlQuestionsForStaff.Visible = False

    ElseIf ButtonTextID = _Acknowledge Then
        BuildQuestionControl(pnlQuestionsForSupervisor, "[spFill_Supervision_ViewQuestionsForSupervisior]", "@SupervisionID", currSupervisionID, "@StaffRosterID", currStaffRosterID)
        pnlQuestionsForSupervisor.Enabled = False
        BuildQuestionControl(pnlQuestionsForStaff, "[spGet_Supervision_QuestionsForStaff]", "@SupervisionID", currSupervisionID, "@StaffRosterID", currStaffRosterID)
        dtpSupervisionDate.Enabled = False
    ElseIf ButtonTextID = _View Then
        BuildQuestionControl(pnlQuestionsForSupervisor, "[spFill_Supervision_ViewQuestionsForSupervisior]", "@SupervisionID", currSupervisionID, "@StaffRosterID", currStaffRosterID)
        pnlQuestionsForSupervisor.Enabled = False
        BuildQuestionControl(pnlQuestionsForStaff, "[spFill_Supervision_ViewQuestionsForStaff]", "@SupervisionID", currSupervisionID, "@StaffRosterID", currStaffRosterID)

        pnlQuestionsForStaff.Enabled = False
        btnSubmit.Visible = False
        dtpSupervisionDate.Enabled = False
    End If



End Sub

Protected Sub btnSubmit_Click(sender As Object, e As EventArgs) Handles btnSubmit.Click
    Page.Validate()
    If Page.IsValid Then
        If ButtonTextID = _Add Then
            ' SaveSupervision()
            ' SaveSupervisionStaff()
        ElseIf ButtonTextID = _Acknowledge AndAlso Not chkNoComment.checked = True Then
            ' SaveAcknowledgeQuestions()
        End If

        ScriptManager.RegisterStartupScript(Page, Me.GetType, "refreshParent", "refreshParent(); ", True)
    Else
        ScriptManager.RegisterStartupScript(Me, Me.GetType, "Error", "alert('Please make sure all fields are filled.');", True)

    End If
End Sub
...