Click here to Skip to main content
15,885,278 members
Home / Discussions / ASP.NET
   

ASP.NET

 
AnswerRe: Get name of a control in Code behind Pin
Richard Deeming26-Mar-15 3:06
mveRichard Deeming26-Mar-15 3:06 
Questionis asp.net code is same as vb.net (except the declaration) Pin
Member-unknown25-Mar-15 3:36
Member-unknown25-Mar-15 3:36 
AnswerRe: is asp.net code is same as vb.net (except the declaration) Pin
Afzaal Ahmad Zeeshan25-Mar-15 4:07
professionalAfzaal Ahmad Zeeshan25-Mar-15 4:07 
GeneralRe: is asp.net code is same as vb.net (except the declaration) Pin
Member-unknown25-Mar-15 6:37
Member-unknown25-Mar-15 6:37 
GeneralRe: is asp.net code is same as vb.net (except the declaration) Pin
F-ES Sitecore25-Mar-15 7:30
professionalF-ES Sitecore25-Mar-15 7:30 
AnswerRe: is asp.net code is same as vb.net (except the declaration) Pin
Richard Deeming25-Mar-15 8:48
mveRichard Deeming25-Mar-15 8:48 
GeneralRe: is asp.net code is same as vb.net (except the declaration) Pin
ZurdoDev25-Mar-15 11:03
professionalZurdoDev25-Mar-15 11:03 
QuestionASPX How to get the form initiated from OperatePage - actually should be the existing instance Pin
QuickBooksDev24-Mar-15 4:49
QuickBooksDev24-Mar-15 4:49 
I have a simple VB.Net web app that gets a large table based on Form controls and I need it display the progress such as Doing 'Record# nnn'.

This method can be simulated with via clicking on a button the the form is initiated which is the instance that we need to access. lblMsg is a label on the form what I would like to update.
Public Function GetTable
   Dim I as Integer
   for I = 1 to 10
      lblMsg.Text = "Doing Record# " & i
      Sleep 1000
   next
End Function


We are currently trying the below but when GetTable gets control lblMsg is nothing which means that the form is not initialed.

How can I get this to work?
XML
$(document).ready(function () {

                    $("#btnTrial").click(function (e) {

                        e.preventDefault();
                        $("#btnTrial").attr('disabled', 'disabled');

                        var total = 5;
                        if (document.getElementById('<%=txtLoopRows.ClientID %>').value != "") {
                            var total = document.getElementById('<%=txtLoopRows.ClientID %>').value;
                        }
                        // comes here the first time
                        PageMethods.OperatePage(total, function (result) {


                            if (result) {
                                setTimeout($.updateProgressbar, 500);
                            }
                        });
                    });
                });


<System.Web.Services.WebMethod(EnableSession:=True)> _
   Public Shared Function OperatePage(total As Integer) As Object

       Dim session As HttpSessionState = HttpContext.Current.Session

       Dim totalParsed As Integer = 0
       Integer.TryParse(total.ToString(), totalParsed)
       _TotalLoop = totalParsed  ' 1

       System.Threading.ThreadPool.QueueUserWorkItem(AddressOf ThreadProc, session)  '  Sets to invoke ThreadProc

       Return New With {.progress = 0}
   End Function


<System.Web.Services.WebMethod(EnableSession:=True)> _
 Public Shared Function ThreadProc(ByVal stateInfo As Object) '2
     '  Loops with sleep but sets StateVariable to the counter which is picked up by Progress Page then to $.updateProgressbar = function
     '  InfusionSoft stuff here
     Dim DefPage As New _Default
     DefPage.GetTable(stateInfo)  ' Invokes but form variables are nothing

     stateInfo("TICK") = Nothing
 End Function

Thanks

modified 24-Mar-15 11:18am.

AnswerRe: ASPX How to get the form initiated from OperatePage - actually should be the existing instance Pin
F-ES Sitecore24-Mar-15 8:25
professionalF-ES Sitecore24-Mar-15 8:25 
GeneralRe: ASPX How to get the form initiated from OperatePage - actually should be the existing instance Pin
QuickBooksDev24-Mar-15 9:56
QuickBooksDev24-Mar-15 9:56 
GeneralRe: ASPX How to get the form initiated from OperatePage - actually should be the existing instance Pin
F-ES Sitecore24-Mar-15 10:16
professionalF-ES Sitecore24-Mar-15 10:16 
GeneralRe: ASPX How to get the form initiated from OperatePage - actually should be the existing instance Pin
QuickBooksDev25-Mar-15 10:55
QuickBooksDev25-Mar-15 10:55 
GeneralRe: ASPX How to get the form initiated from OperatePage - actually should be the existing instance Pin
F-ES Sitecore25-Mar-15 11:17
professionalF-ES Sitecore25-Mar-15 11:17 
GeneralRe: ASPX How to get the form initiated from OperatePage - actually should be the existing instance Pin
QuickBooksDev26-Mar-15 2:30
QuickBooksDev26-Mar-15 2:30 
AnswerRe: ASPX How to get the form initiated from OperatePage - actually should be the existing instance Pin
jkirkerx24-Mar-15 9:39
professionaljkirkerx24-Mar-15 9:39 
GeneralRe: ASPX How to get the form initiated from OperatePage - actually should be the existing instance Pin
QuickBooksDev25-Mar-15 10:53
QuickBooksDev25-Mar-15 10:53 
GeneralRe: ASPX How to get the form initiated from OperatePage - actually should be the existing instance Pin
jkirkerx26-Mar-15 10:28
professionaljkirkerx26-Mar-15 10:28 
GeneralRe: ASPX How to get the form initiated from OperatePage - actually should be the existing instance Pin
QuickBooksDev26-Mar-15 10:38
QuickBooksDev26-Mar-15 10:38 
GeneralRe: ASPX How to get the form initiated from OperatePage - actually should be the existing instance Pin
jkirkerx26-Mar-15 11:06
professionaljkirkerx26-Mar-15 11:06 
GeneralRe: ASPX How to get the form initiated from OperatePage - actually should be the existing instance Pin
QuickBooksDev27-Mar-15 3:54
QuickBooksDev27-Mar-15 3:54 
QuestionWrong count is also accepting in Jquery and accepting keywords any where Pin
venu.rayapati24-Mar-15 2:02
professionalvenu.rayapati24-Mar-15 2:02 
Questiongive me solution plzzzzzzzzzz Pin
Member 1149988323-Mar-15 19:08
Member 1149988323-Mar-15 19:08 
SuggestionRe: give me solution plzzzzzzzzzz Pin
Richard MacCutchan23-Mar-15 22:30
mveRichard MacCutchan23-Mar-15 22:30 
AnswerRe: give me solution plzzzzzzzzzz Pin
F-ES Sitecore23-Mar-15 22:38
professionalF-ES Sitecore23-Mar-15 22:38 
AnswerRe: give me solution plzzzzzzzzzz Pin
ZurdoDev24-Mar-15 8:53
professionalZurdoDev24-Mar-15 8:53 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.