2 Replies - 394 Views - Last Post: 30 May 2019 - 12:04 PM Rate Topic: -----

#1 DarenR   User is offline

  • D.I.C Lover

Reputation: 624
  • View blog
  • Posts: 4,165
  • Joined: 12-January 10

quirky update panel issue

Posted 30 May 2019 - 11:37 AM

i have an update panel that is triggered by a button which works
however i also need it to work if a drop down selection is changed.

it looks like it goes through the steps but nothing actually happens to the panel on selectindexchange

the back end shows all the actual changes but the panel itself remains the same

basically when someone chooses a different time from the ddl the panel should check for existing items and if they are there display them and if not remove the contents from the update panel.

the button is an edit button which works as it should

  <asp:Panel runat="server" id="ArgumentsPnl"  groupingtext="Used Arguments For The Hour" Visible="false">
                    <asp:UpdatePanel runat="server" id="uPnlArguments" UpdateMode="Conditional">


trigger
 <Triggers> 
                            <asp:AsyncPostBackTrigger ControlID="ddlHour" EventName="SelectedIndexChanged" /> 
                        </Triggers>




event:

 Protected Sub ddlHour_onselectedIndexChanged(sender As Object, e As EventArgs)
        clearFields()
        txtHourDowntime.text = String.Empty
        txtUnaccounted.Text = String.Empty
        txtAccounted.Text = String.Empty
        txtProductionTime.Text = string.Empty
        loadHourlyDowntime()
        loadHourlyUnAccouuntedMinutes()
        ShowProductionTime()
        ShowAccouuntedDownTime()
        LoadIDs()
      '  LoadUsedArguments()   <--- all work except this one
    End Sub



 Protected sub LoadUsedArguments()
        Dim _argumentDs as new DataSet
        Dim _loadEditable As New LoadEditableData
        Dim _argument As String = ""
        Dim _Minutes As Decimal = 0.00
        Dim _shiftID As Integer = GetSafeInteger(convert.ToInt32(txtHourlyShiftID.text))
        Dim _TransStartTime as String = ""
        _TransStartTime = GetSafeString(ddlHour.SelectedItem.Text)
        _argumentDs = _loadEditable.LoadHourlyArgumentsForEdit(_shiftID,_TransStartTime)

        if _argumentDs.Tables.Count > 0 then
            ArgumentsPnl.Visible = true
            grdArguments.Visible = true
            If _editEnabled = 0 then
                grdArguments.DataSource = _argumentDs.Tables(0)
                grdArguments.DataBind()
                EditArgumentsBtn.Visible = True
                For each gr in grdArguments.Rows
                    DIM txtArgumentsUsed As TextBox = CType(gr.FindControl("txtArgumentsUsed"), TextBox)
                    Dim txtMinutesUsed As TextBox = CType(gr.FindControl("txtMinutesUsed"), TextBox)
                    txtArgumentsUsed.ReadOnly = True
                    txtMinutesUsed.ReadOnly = True
                    txtArgumentsUsed.CssClass = "DataGridReadOnly"
                    txtMinutesUsed.CssClass = "DataGridReadOnly"
                Next
            Else if _editEnabled = 1
                For each gr in grdArguments.Rows
                    DIM txtArgumentsUsed As TextBox = CType(gr.FindControl("txtArgumentsUsed"), TextBox)
                    Dim txtMinutesUsed As TextBox = CType(gr.FindControl("txtMinutesUsed"), TextBox)
                    txtArgumentsUsed.ReadOnly = False
                    txtMinutesUsed.ReadOnly = False
                    txtArgumentsUsed.CssClass = "DataGridEdit"
                    txtMinutesUsed.CssClass = "DataGridEdit"
                Next
            end if
        else if _argumentDs.Tables.Count < 1   <-- put this in for testing and it says it should work
            grdArguments.Visible = false
            ArgumentsPnl.Visible = false
           
        end if

    End sub



not sure why it doesnt execute correctly
also if you do multiple changes on the ddl that method errors out but none of the other methods do


thoughts

Is This A Good Question/Topic? 0
  • +

Replies To: quirky update panel issue

#2 modi123_1   User is online

  • Suitor #2
  • member icon



Reputation: 15160
  • View blog
  • Posts: 60,694
  • Joined: 12-June 08

Re: quirky update panel issue

Posted 30 May 2019 - 12:00 PM

When you uncomment this are you able step into the function? See where abouts it may be going off the rails?

12     '  LoadUsedArguments()   <--- all work except this one

Was This Post Helpful? 0
  • +
  • -

#3 DarenR   User is offline

  • D.I.C Lover

Reputation: 624
  • View blog
  • Posts: 4,165
  • Joined: 12-January 10

Re: quirky update panel issue

Posted 30 May 2019 - 12:04 PM

yes--- and all looks good then just dies and a weird event error comes back about autoevent validation is secure and asks to open an extra debugger


i dont have event validation in fact it is set to false


my work around is that i added the following:

  Dim dt As New DataTable
            grdArguments.DataSource = dt
            grdArguments.DataBind()


which removes the table but the panel still shows-- well it is better than nothing for now
Was This Post Helpful? 0
  • +
  • -

Page 1 of 1