Click here to Skip to main content
15,890,123 members
Home / Discussions / ASP.NET
   

ASP.NET

 
GeneralRe: Inheritance [Longish Post] Pin
Keith Barrow30-Sep-10 9:39
professionalKeith Barrow30-Sep-10 9:39 
QuestionAsp.net Cross Page Post Back issue Pin
AndieDu28-Sep-10 20:44
AndieDu28-Sep-10 20:44 
AnswerRe: Asp.net Cross Page Post Back issue Pin
Not Active29-Sep-10 2:43
mentorNot Active29-Sep-10 2:43 
GeneralRe: Asp.net Cross Page Post Back issue Pin
AndieDu29-Sep-10 13:36
AndieDu29-Sep-10 13:36 
QuestionWhich approach is faster ? calculate Image size in Server or Client ? Pin
Nadia Monalisa28-Sep-10 19:40
Nadia Monalisa28-Sep-10 19:40 
AnswerRe: Which approach is faster ? calculate Image size in Server or Client ? Pin
vaghelabhavesh29-Sep-10 18:08
vaghelabhavesh29-Sep-10 18:08 
GeneralRe: Which approach is faster ? calculate Image size in Server or Client ? Pin
Nadia Monalisa29-Sep-10 19:05
Nadia Monalisa29-Sep-10 19:05 
QuestionAsynchronous webmethods Pin
david vermeulen28-Sep-10 19:19
david vermeulen28-Sep-10 19:19 
Hi,

I am fairly new to asp.net and need a bit of help please. In our project we are doing a callback from the client-side to the server side using a webmethod in order to try and keep the page request alive. From what I can see in Firebug is that, on the server side, the webmethod is triggered successfully from the javascript until I start with my async event on the server side, then the webmethod waits for it to be finished before the javascript calls the pagemethod again.

However this process of ours can take anything from 1 minute to 40 minutes, so it is quiet essential that I keep the page request alive. I don't want to increase the timeout on the scriptmanager since I don't think that is the right way to approach this issue.

Here is a small sample of how the code code is:

Java script:
function SimpleCallback() {
   var lCurrentStatus = PageMethods.GetCurrentStatus(ProcessResults);
}

function ProcessResults(pCurrentStatus) {
   if (pCurrentStatus != "Completed") {
       window.setTimeout("SimpleCallback()", 100);
   }
}

function SaveButtonClick(pArgument) {
   var lAjaxManager = $find("<%= MyAjaxManager.ClientId %>");
   lAjaxManager.ajaxRequest(pArgument);
   SimpleCallback();
}

<asp:Button ID="SaveButton" runat="server" Text="Save" OnClientClick="return SaveButtonClick('SaveStuff');"


Server side code:
[WebMethod]
public static string GetCurrentStatus()
{
   return FCurrentStatus;
}

protected void MyAjaxManager_AjaxRequest(object sender, AjaxRequestEventArgs e)
{
    if (e.Argument == "SaveStuff")
    {
        FCurrentStatus = "ProcessRunning";
        SaveInformation();
    }
}

//While this is being executed the webmetod, GetCurrentStatus, is ignored until this process is completed
delegate void MyLongRunningProcess();

private void SaveInformation()
{
  var lLongRunningMethod = new MyLongRunningProcess(NextClass.Save());
  
  IAsyncResult lResult = lLongRunningMethod.BeginInvoke(null, null);

  while (!lResult.IsCompleted)
  {
     //Update progressbar with new percentage
  }
 
  lLongRunningMethod.EndInvoke(lResult);
}


Is there a way of doing the pagemethod call from javascript asynchronously, since it seems this is my problem. Or is there another way of approaching this in order to keep the page request alive?

Thank you in advance,
David.
AnswerRe: Asynchronous webmethods Pin
Not Active29-Sep-10 2:51
mentorNot Active29-Sep-10 2:51 
AnswerRe: Asynchronous webmethods Pin
NeverHeardOfMe29-Sep-10 3:54
NeverHeardOfMe29-Sep-10 3:54 
QuestionPost via email Pin
Jassim Rahma28-Sep-10 12:35
Jassim Rahma28-Sep-10 12:35 
QuestionNavigationURL question Pin
Jassim Rahma28-Sep-10 12:26
Jassim Rahma28-Sep-10 12:26 
AnswerRe: NavigationURL question Pin
Not Active28-Sep-10 13:49
mentorNot Active28-Sep-10 13:49 
QuestionExpires question Pin
Jassim Rahma28-Sep-10 10:46
Jassim Rahma28-Sep-10 10:46 
AnswerRe: Expires question Pin
thatraja28-Nov-10 1:24
professionalthatraja28-Nov-10 1:24 
Questionabout configuration file Pin
Dhyanga28-Sep-10 5:52
Dhyanga28-Sep-10 5:52 
AnswerRe: about configuration file Pin
JHizzle28-Sep-10 6:04
JHizzle28-Sep-10 6:04 
GeneralRe: about configuration file Pin
Dhyanga28-Sep-10 6:08
Dhyanga28-Sep-10 6:08 
GeneralRe: about configuration file Pin
Not Active28-Sep-10 6:19
mentorNot Active28-Sep-10 6:19 
GeneralRe: about configuration file Pin
Dhyanga28-Sep-10 7:29
Dhyanga28-Sep-10 7:29 
GeneralRe: about configuration file Pin
Not Active28-Sep-10 7:57
mentorNot Active28-Sep-10 7:57 
GeneralRe: about configuration file Pin
Dhyanga28-Sep-10 8:02
Dhyanga28-Sep-10 8:02 
GeneralRe: about configuration file Pin
Not Active28-Sep-10 8:07
mentorNot Active28-Sep-10 8:07 
GeneralRe: about configuration file Pin
Dhyanga28-Sep-10 8:23
Dhyanga28-Sep-10 8:23 
GeneralRe: about configuration file Pin
Not Active28-Sep-10 8:36
mentorNot Active28-Sep-10 8:36 

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.