Click here to Skip to main content
16,015,679 members
Home / Discussions / ASP.NET
   

ASP.NET

 
GeneralRe: how to position div just over the textbox? Pin
Tridip Bhattacharjee13-Nov-10 22:49
professionalTridip Bhattacharjee13-Nov-10 22:49 
GeneralRe: how to position div just over the textbox? Pin
Brij13-Nov-10 23:52
mentorBrij13-Nov-10 23:52 
QuestionHow to pass data to gridview(Long Post) Pin
future383913-Nov-10 13:46
future383913-Nov-10 13:46 
AnswerRe: How to pass data to gridview(Long Post) Pin
thatraja15-Nov-10 1:47
professionalthatraja15-Nov-10 1:47 
QuestionWhat is best way to show Grid inside a TabPanel Pin
Steve van Niman13-Nov-10 11:26
Steve van Niman13-Nov-10 11:26 
QuestionHost Web Service and Web Site in virtual directory & app pool Pin
kakarato13-Nov-10 5:06
kakarato13-Nov-10 5:06 
AnswerRe: Host Web Service and Web Site in virtual directory & app pool Pin
Brij13-Nov-10 7:14
mentorBrij13-Nov-10 7:14 
Questionmultiple getJSON issue [modified] Pin
musefan12-Nov-10 5:28
musefan12-Nov-10 5:28 
Hi All,

I am using asp.net MVC 2 and am having an issue running two getJSON commands at the same time.

However I try to re-arange the code the second one waits for the first one to finish before runnning. Consider this code as an example.

var InProgress = false;
function Start(){
   InProgress = true;
   DoSomething();
   UpdateProgress();
}

function DoSomething(){
   $.getJSON("url", {}, function(data){
      InProgress = false;
      $("#text").text("Complete");
   });
}

function UpdateProgress(){
   if(InProgress){
      $.getJSON("url2", {}, function(data){
         $("#text").text(data.Percent);
         setInterval(UpdateProgress(), 500);
      }
   }
}


Basically, I am trying to get a progress report for the main process.

What is happening is...

Start() called
UpdateProgress() called
text updated
DoSomething() called
UpdateProgress() called (But only after DoSomething getJSON has finished)

The whole process runs for about 5 - 10 seconds so UpdateProgress should be called many more times.

Can anyone help with why this would happen? I cannot find anything on the web to help me out

Thanks

EDIT
--------

I have found what the problem is. I was using Session (assigning the progress value to) in the Actions that the getJSON commands called. And for some reason this was forcing the second getJSON to wait. Removed session references, problem fixed.

However my problem now is, what do I use instead of Session. I basically need to persist a variable value across multiple action calls. I understand that essentially for two action to run together then they must be on different threads somewhere along the line. So I guess that is the issue.

Any idea's cleaver people?
Life goes very fast. Tomorrow, today is already yesterday.
modified on Friday, November 12, 2010 11:54 AM

QuestionFail to avoid postback for button click Pin
Tridip Bhattacharjee11-Nov-10 23:01
professionalTridip Bhattacharjee11-Nov-10 23:01 
AnswerRe: Fail to avoid postback for button click Pin
Brij12-Nov-10 1:12
mentorBrij12-Nov-10 1:12 
GeneralRe: Fail to avoid postback for button click Pin
Tridip Bhattacharjee12-Nov-10 2:00
professionalTridip Bhattacharjee12-Nov-10 2:00 
GeneralRe: Fail to avoid postback for button click Pin
Brij12-Nov-10 6:38
mentorBrij12-Nov-10 6:38 
QuestionShowing content pages without MasterPage in DesignView. Pin
Asif Rehman11-Nov-10 4:03
Asif Rehman11-Nov-10 4:03 
AnswerRe: Showing content pages without MasterPage in DesignView. Pin
Brij11-Nov-10 6:32
mentorBrij11-Nov-10 6:32 
AnswerRe: Showing content pages without MasterPage in DesignView. Pin
Vimalsoft(Pty) Ltd14-Nov-10 20:03
professionalVimalsoft(Pty) Ltd14-Nov-10 20:03 
QuestionDetailsView FormView - SelectedValue bug Pin
Hanzaplast11-Nov-10 3:10
Hanzaplast11-Nov-10 3:10 
QuestionNavigating from a page to Wizrd page Pin
meeram39511-Nov-10 2:47
meeram39511-Nov-10 2:47 
AnswerRe: Navigating from a page to Wizrd page Pin
Not Active11-Nov-10 3:10
mentorNot Active11-Nov-10 3:10 
GeneralRe: Navigating from a page to Wizrd page Pin
meeram39511-Nov-10 12:30
meeram39511-Nov-10 12:30 
GeneralRe: Navigating from a page to Wizrd page Pin
Not Active11-Nov-10 12:46
mentorNot Active11-Nov-10 12:46 
QuestionAspDotNetStorefront Pin
Civic0611-Nov-10 2:33
Civic0611-Nov-10 2:33 
Questionhow to show busy indicator in the center of multiline textbox control Pin
Tridip Bhattacharjee11-Nov-10 1:51
professionalTridip Bhattacharjee11-Nov-10 1:51 
AnswerRe: how to show busy indicator in the center of multiline textbox control Pin
Not Active11-Nov-10 2:31
mentorNot Active11-Nov-10 2:31 
GeneralRe: how to show busy indicator in the center of multiline textbox control Pin
Tridip Bhattacharjee11-Nov-10 19:09
professionalTridip Bhattacharjee11-Nov-10 19:09 
GeneralRe: how to show busy indicator in the center of multiline textbox control Pin
Rhys Gravell11-Nov-10 21:33
professionalRhys Gravell11-Nov-10 21:33 

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.