Jump to content
Xtreme .Net Talk

Recommended Posts

Posted

I am just trying out AJAX and am having a slight problem. Right now, my VS 2003 and VS 2005 @ work are on the fritz, so I can't even pop my page into it to try to see if I can get an answer.

 

Anyways, my question:

 

When I do a simple Response.Write in my aspx form to return to my JavaScript, it works fine. I'm just making it return the current time. It doesn't refresh the time, which is fine, because I know how to fix it. The problem is the fix is what kills me!

 

When I put Response.Expires=-1 or Response.Expires=0 or anything OTHER THAN Response.Write in my code, my code no longer returns anything.

 

I am using .NET Framework 2.0 to program with. Any and all help will be GREATLY appreciated!

Check out my blog! DevPaper.NET
Posted

Quick Update:

 

It allows me to use the page if I put the following code on the page:

 

Response.Cache.SetExpires(DateTime.Now.AddSeconds(1));

 

The problem is that (for example) a time update lets you see every OTHER second.

 

Thanks once again in advance!

 

~Derek

 

Edit: Also, it doesn't work with the DateTime.Now.AddMillisecond() property.

 

Thanks again!

Check out my blog! DevPaper.NET
Posted

Got it!

 

My findings:

 

The proper way to assign a returned-value from an ASP page is to set the returned value to a variable. Send that variable to another function and assign it to the textbox/div/whatever else you want to.

 

My problem was that I was trying to set a value to a div outside of the enclosed if statement, which checked to make sure there was data in it.

 

Thanks anyways!

 

~Derek

Check out my blog! DevPaper.NET

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...