dcsimg
Results 1 to 14 of 14

Thread: [RESOLVED] Problems with Secondary History Buttons After Page load

  1. #1

    Thread Starter
    Junior Member
    Join Date
    Nov 2018
    Posts
    20

    Resolved [RESOLVED] Problems with Secondary History Buttons After Page load

    Visual Basic
    .NET Framework 4.6
    Visual Studio 2015

    Greeting Everyone !! This is my first post here on this Forum, any advice would help and be much appreciated. I've been running thru my debugger multiple times and haven't been able to fully comprehend what my actual problem is.


    Summary of the application:
    So I am working on an web application that is a Single-Page Applications (SPAs), in VB.NET, it is similar to a Insurance company a insurance agent can log in and view their insurance claims, along with other unattached claims.Once the user is logged as an active user and they are able to view a dashboard.("Main-Dashboard", "Inbox", "Messages"). Each set view has its own front-UI.aspx with some code behind aspx.vb. There is already a <Runat="server"> associated with each dashboard view, so the data get loaded and displays like claim number and type of claim along with date of claim, and person assigned to it.

    The Problem:
    There is a history button/img-tag associated with each case number, that will not allow the front UX page to pass the {text.doc.Id} information to the back end to run the method signature to invoke the history function.

    What I found:
    -All the initial Data is loaded using a javascript function PushPropPg()
    -The history button Works ONLY on the Main-Dashboard homepage, all of the other sub dashboards have thrown an error BC 30456 "txt" is not a member of 'member_inbox'
    -What I am finding is after the btnClick {txt.Doc.Id} is being replaced with "blank", when its supposed to grab the {doc.text}
    -History function will get triggered, if I set the deliberately set txt.doc.id = "J10294".

    Has anyone ran into a problem like this before? I don't think its a java Script problem, but it could possibly be, I can't tell if its a VB.NET problem either but I'm not sure my guesses have led me to some sort of broken {System.Web.UI.EventHandler}

    Sorry if I can't post code There's multiple files that get passed around, too many to count.

    Any helpful hints or directions would greatly be appreciated.
    Attached Images Attached Images    

  2. #2
    Bad man! ident's Avatar
    Join Date
    Mar 2009
    Location
    Cambridge
    Posts
    5,216

    Re: Problems with Secondary History Buttons After Page load

    Hard without code. I only studied VB with aspx briefly in 2005, is ispostback set?

  3. #3

    Thread Starter
    Junior Member
    Join Date
    Nov 2018
    Posts
    20

    Re: Problems with Secondary History Buttons After Page load

    I'm not sure which VB.NET Code to show you, each UX page has its own back end request. I will defiantly check ispostback set in all the other files.


    Name:  PostBack_Master.jpg
Views: 34
Size:  24.2 KB This is my current master.vb which has the main is post back, I don't see anything out of the ordinary other than refreshing the page if the person is not a logged in user.

  4. #4
    Bad man! ident's Avatar
    Join Date
    Mar 2009
    Location
    Cambridge
    Posts
    5,216

    Re: Problems with Secondary History Buttons After Page load

    Quote Originally Posted by Tygre View Post
    I'm not sure which VB.NET Code to show you, each UX page has its own back end request. I will defiantly check ispostback set in all the other files.


    Name:  PostBack_Master.jpg
Views: 34
Size:  24.2 KB This is my current master.vb which has the main is post back, I don't see anything out of the ordinary other than refreshing the page if the person is not a logged in user.
    You are posting screenshots I can't even see. Please post the code.

  5. #5

    Thread Starter
    Junior Member
    Join Date
    Nov 2018
    Posts
    20

    Re: Problems with Secondary History Buttons After Page load

    ** This is the page load for Dashboard tab "USER INBOX" *****

    Code:
    Partial Class _Controls_usrInboxList
        Inherits System.Web.UI.UserControl
        Dim miId As Int32 = 0            ' increment for image ids
        Dim miRowCount As Integer = 0
        Dim moTransactionIdList As New Generic.List(Of Integer)
        
        Protected Sub Page_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Load
    
            If Not Me.Page.ClientScript.IsClientScriptIncludeRegistered("GetAbsPosition") Then
                Me.Page.ClientScript.RegisterClientScriptInclude("GetAbsPosition", Page.ResolveClientUrl("~/JS/GetAbsPosition.js"))
            End If
    
            If Not Me.Page.ClientScript.IsClientScriptIncludeRegistered("QuickSort") Then
                Me.Page.ClientScript.RegisterClientScriptInclude("QuickSort", Page.ResolveClientUrl("~/JS/QuickSort.js"))
            End If
    
            ScriptManager.RegisterStartupScript(Me, GetType(Page), "DownloadF", "downloadF();", True)
    
            Me.pnlH.Style.Item("display") = "none"
    
            Dim iMessageDoc As Integer = 0
            Integer.TryParse(Me.txtDocId.Text, iMessageDoc)
    
            Dim oRep As New WebRep
    
            If iMessageDoc > 0 Then
                usrMessageList1.SetDeleteDelgate(AddressOf DeleteMessageClick)     'override that in the control so the pop up can stay open
                usrMessageList1.LoadData(oRep.ActiveUser.Id, iMessageDoc, True)
            End If
    
        End Sub
    ** This is the page load for Dashboard tab "USER INBOX" *****
    Last edited by Tygre; Nov 12th, 2018 at 03:19 PM.

  6. #6

    Thread Starter
    Junior Member
    Join Date
    Nov 2018
    Posts
    20

    Re: Problems with Secondary History Buttons After Page load

    ** This is the the helper function that builds the table with and adds the Data from the data source *****

    Code:
     Public Sub LoadData(ByVal voList As List(Of OPS.DataItem))
            Me.cbSelectAll.Visible = False
    
            Dim oCell As TableCell
            Dim oRow As TableRow
    
            Dim bAlternate As Boolean = False
            Dim oTable As New Table()
            oTable.Width = New Unit(100, UnitType.Percentage)
    
            Me.pnlResult.Controls.Clear()
            oTable.ID = "tblItems"
            oTable.CssClass = "fieldheading"
    
            If voList.Count > 0 Then
                Me.lblCount.Text = voList.Count.ToString() & IIf(voList.Count = 1, " item", " items")
                Me.lblCount2.Text = Me.lblCount.Text
    
                Dim iCounter As Int32 = 0
                oTable.Rows.Add(AddHeader())
                miRowCount = voList.Count
    
                For Each oItem As OPS.DataItem In voList
                    iCounter += 1
                    oRow = New TableRow
    
                    If bAlternate Then
                        oRow.CssClass = "altrow"
                    Else
                        oRow.CssClass = "row"
                    End If
    
                    bAlternate = Not bAlternate
    
                    'Header-CaseNo
                    oCell = New TableCell
                    oCell.CssClass = "drtext"
    
                    oCell.Controls.Add(New LiteralControl("&nbsp;<a href=""javascript:pushPropPg('imgHI" & miId.ToString() & "','" & oItem.CaseId.ToString() & "', '" & oItem.ClaimNumber & "', 'History')"">" &
                      "<img src=""../Images/wrench.png"" border=""0"" alt=""History"" id=""imgHI" & miId.ToString() & """ /></a>"))
    
                    oCell.Controls.Add(New LiteralControl("<a class=""hyperlinksmall"" href=""javascript:GoTo('" & oItem.CaseId.ToString() & "')"">" & oItem.ClaimNumber & "</a>"))
    
                  
                    miId += 1
                    oRow.Cells.Add(oCell)
    
                    'Header-Date Submitted
                    oRow.Cells.Add(AddCell(oItem.DateCreatedOrSubmitted.ToShortDateString(), , oItem.DateCreatedOrSubmitted))
    
                    'Header-Date Assigned
                    oRow.Cells.Add(AddCell(IIf(oItem.DateAssigned = Date.MinValue, oItem.DateCreatedOrSubmitted.ToShortDateString(), oItem.DateAssigned.ToShortDateString()), , IIf(oItem.DateAssigned = Date.MinValue, oItem.DateCreatedOrSubmitted, oItem.DateAssigned)))
    
                    'Header-Date Pended
                    Dim oC As New TableCell
                    oC.Controls.Add(New LiteralControl(IIf(oItem.DatePended = Date.MinValue, "", oItem.DatePended.ToShortDateString())))
    
    
                    If oItem.DatePended <> Date.MinValue AndAlso oItem.PendNote.Length > 0 Then
                        oC.Attributes.Add("Sort", SessionMgr.GetNumericSort("" & SessionMgr.GetDateSort(oItem.DatePended.ToString())))
    
                        Dim oPanel As New Panel
                        oPanel.ID = "pnlPend" & oItem.CaseId.ToString()
                        oPanel.Width = New Unit(220, UnitType.Pixel)
                        oPanel.Style.Item("display") = "none"
                        oPanel.Style.Item("POSITION") = "absolute"
                        oPanel.CssClass = "pendnote"
                        oPanel.Controls.Add(New LiteralControl(oItem.PendNote))
    
                        Me.divwrapper.Controls.Add(oPanel)
    
                        oC.Controls.Add(New LiteralControl("<a href=""javascript:showxpend('" & oPanel.ClientID.ToString() & _
                                  "','imgp" & oItem.CaseId.ToString() & "')"">" & _
                                  "<img onmouseover=""showxpend('" & oPanel.ClientID.ToString() & "','imgp" & oItem.CaseId.ToString() & "')""" & _
                                  " onmouseout=""closexpend('" & oPanel.ClientID.ToString() & "')"" " & _
                                  " src=""../Images/Pend.gif"" border=""0"" alt="""" id=""imgp" & oItem.CaseId.ToString() & """ /></a>"))
                    End If
    
                    oRow.Cells.Add(oC)
    
                    'Workflow Step
                    oRow.Cells.Add(AddCell(oItem.Stepname, False))
    
                    oTable.Rows.Add(oRow)
                Next
    
                Me.pnlResult.Controls.Add(oTable)
                Me.pnlResult.CssClass = "bordercontent"
            Else
                Me.lblCount2.Text = "No items found."
                Me.lblCount.Text = ""
            End If
        End Sub
    ** This is the the helper function that builds the table with and adds the Data from the data source *****
    Last edited by Tygre; Nov 12th, 2018 at 03:19 PM.

  7. #7

    Thread Starter
    Junior Member
    Join Date
    Nov 2018
    Posts
    20

    Re: Problems with Secondary History Buttons After Page load

    *******Front Facing UX has this *****

    Code:
     
    
    <%@ Page Title="" Language="VB" MasterPageFile="~/Master/VC.master" AutoEventWireup="false" CodeFile="Work.aspx.vb" Inherits="Member_Work" %>
    
     <%@MasterType TypeName="Master_VC" %>
    
    
      <%@Register src="../_Controls/usrDataItemList.ascx" tagname="usrDataItemList" tagprefix="uc1" %>
    
    
    <asp:Content ID="Content1" ContentPlaceHolderID="ContentPlaceHolder1" Runat="Server">
    <asp:UpdatePanel runat="server" ID="upUpdatePanel1"><ContentTemplate>
    
       
    <asp:Label runat="server" ID="lblErr" CssClass="err"></asp:Label>
      
    <uc1:usrDataItemList ID="usrDataItemList1" runat="server" />
    </ContentTemplate>
    
    
    
    </asp:UpdatePanel>
    
    
    </asp:Content>

    *******Front Facing UX *****
    Last edited by Tygre; Nov 12th, 2018 at 03:20 PM.

  8. #8
    PowerPoster
    Join Date
    Sep 2005
    Location
    Modesto, Ca.
    Posts
    3,845

    Re: Problems with Secondary History Buttons After Page load

    When you post code you can use the "#" tags and the code will keeps its formatting. Don't use the Quote tag.

  9. #9

    Thread Starter
    Junior Member
    Join Date
    Nov 2018
    Posts
    20

    Re: Problems with Secondary History Buttons After Page load

    Gotcha!

  10. #10
    Superbly Moderated NeedSomeAnswers's Avatar
    Join Date
    Jun 2002
    Location
    Manchester uk
    Posts
    2,479

    Re: Problems with Secondary History Buttons After Page load

    I suspect your problem is one of scope.

    Your doc.Id is present on your main page so your history button works there, but it is not defined or passed to your other pages properly.

    If you need that value to be available across multiple pages then you might be better off just saving it against the session, as the session persists and you can access it across all your pages more easily.

    So as the user selects a doc item at that point save the selected doc id to the session, then you can grab it on your sub pages easily

    Add a class to you app called MySession then paste in the following code

    Code:
    Imports System
    Imports System.Web
    Imports System.Collections.Generic
    
    <Serializable()>
    Public Class MySession
        Private Sub New()
        End Sub
    
        Public Shared ReadOnly Property Current As MySession
            Get
                Dim session As MySession = CType(HttpContext.Current.Session("__MySession__"), MySession)
    
                If session Is Nothing Then
                    session = New MySession()
                    HttpContext.Current.Session("__MySession__") = session
                End If
    
                Return session
            End Get
        End Property
    
        Public Property SelectedDocId As String
    End Class
    Ten when a user select a document do this -

    Code:
    MySession.Current.SelectedDocId = docid
    in your sub pages you can then just read back the session variable which will have persisted and so be available

    Code:
    docid = MySession.Current.SelectedDocId
    Please Mark your Thread "Resolved", if the query is solved & Rate those who have helped you



  11. #11

    Thread Starter
    Junior Member
    Join Date
    Nov 2018
    Posts
    20

    Lightbulb Re: Problems with Secondary History Buttons After Page load

    Quote Originally Posted by NeedSomeAnswers View Post
    I suspect your problem is one of scope.

    Your doc.Id is present on your main page so your history button works there, but it is not defined or passed to your other pages properly.

    If you need that value to be available across multiple pages then you might be better off just saving it against the session, as the session persists and you can access it across all your pages more easily.

    So as the user selects a doc item at that point save the selected doc id to the session, then you can grab it on your sub pages easily

    Add a class to you app called MySession then paste in the following code

    Code:
    Imports System
    Imports System.Web
    Imports System.Collections.Generic
    
    <Serializable()>
    Public Class MySession
        Private Sub New()
        End Sub
    
        Public Shared ReadOnly Property Current As MySession
            Get
                Dim session As MySession = CType(HttpContext.Current.Session("__MySession__"), MySession)
    
                If session Is Nothing Then
                    session = New MySession()
                    HttpContext.Current.Session("__MySession__") = session
                End If
    
                Return session
            End Get
        End Property
    
        Public Property SelectedDocId As String
    End Class
    Ten when a user select a document do this -

    Code:
    MySession.Current.SelectedDocId = docid
    in your sub pages you can then just read back the session variable which will have persisted and so be available

    Code:
    docid = MySession.Current.SelectedDocId

    Thanks for the input; I'm going to chase down another route with the JS <scripts> </scripts>.
    I'm narrowing it down to the front end because I was able to find that there is a potential problem with client side as to why its not passing in a txtdocid after a onclick function().

  12. #12
    Superbly Moderated NeedSomeAnswers's Avatar
    Join Date
    Jun 2002
    Location
    Manchester uk
    Posts
    2,479

    Re: Problems with Secondary History Buttons After Page load

    Ok i missed something when i first read your posts

    The Problem:
    There is a history button/img-tag associated with each case number, that will not allow the front UX page to pass the {text.doc.Id} information to the back end to run the method signature to invoke the history function.

    What I found:
    -All the initial Data is loaded using a javascript function PushPropPg()
    -The history button Works ONLY on the Main-Dashboard homepage, all of the other sub dashboards have thrown an error BC 30456 "txt" is not a member of 'member_inbox'
    So you Main dashboard History function is a front end JavaScript function

    Your other History functions are Not

    Your not showing us how your other dashboards are loaded, The error your getting suggests that {text.doc.Id} isn't where you think it is, so we need to see how your loading your other dashboard.

    Also your not showing us the back end for your other Dashboard, it is important to see how your expecting {text.doc.Id}to be available in the back end, are you getting it from the request form collection , a query string or something else ?

    The back end doesn't have the same type of access to front end variables like JavaScript does (as JavaScript is in your front end and has the same scope)
    Please Mark your Thread "Resolved", if the query is solved & Rate those who have helped you



  13. #13

    Thread Starter
    Junior Member
    Join Date
    Nov 2018
    Posts
    20

    Re: Problems with Secondary History Buttons After Page load

    Thank you all for your input. Fortunately I was spinning my head around in circles.

    *What I found, after using my debugging tools in Chrome the NETWORK INSPECTOR is very helpful, I was able to narrow down that it was a java script call on the Client Side that wasn't grabbing the text.DOC.ID


    [code]
    document.getElementById('<%=txtRef.ClientId() %>').innerText = sval;
    document.getElementById('<%=txtDocId.ClientId() %>').innerText = id;

    [code]

    [code]
    document.getElementById('<%= me.txtRef.ClientID %>').value = sval;
    document.getElementById('<%= me.txtDocId.ClientID %>').value = id;
    [code]

  14. #14

    Thread Starter
    Junior Member
    Join Date
    Nov 2018
    Posts
    20

    Re: Problems with Secondary History Buttons After Page load

    Thank you all for your input. Fortunately I was spinning my head around in circles.

    *What I found, after using my debugging tools in Chrome the NETWORK INSPECTOR is very helpful, I was able to narrow down that it was a java script call on the Client Side that wasn't grabbing the text.DOC.ID; ultimately I wasn't grabbing the txtDocID because i wasn't setting it value properly.


    Original
    Code:
    document.getElementById('<%=txtRef.ClientId() %>').innerText = sval;
            document.getElementById('<%=txtDocId.ClientId() %>').innerText = id;

    Correct
    Code:
    document.getElementById('<%= me.txtRef.ClientID %>').value = sval;
     document.getElementById('<%= me.txtDocId.ClientID %>').value = id;

Tags for this Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Featured


Click Here to Expand Forum to Full Width