Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > ASP .Net > implement xdocument timeout

Reply
Thread Tools

implement xdocument timeout

 
 
André Freitas
Guest
Posts: n/a
 
      02-12-2010
Im using a xDocument with Linq to get the last 10 blog entries. Like this:

XDocument xDocument = XDocument.Load("SOMEURL");
var linq =
from itens in xDocument.Root.Elements("channel").Elements("item" ).Take(10)
select new
{
title = (string)itens.Element("title"),
link = (string)itens.Element("link")
};
rptBlogFeed.DataSource = linq;
rptBlogFeed.DataBind();

The problem: I already got the blog feed (third-apart) offline a few times,
and when it ocours, if the site is not cached, the user gets a error. I have
encapsulated the code in a TRY clause, and Im returning a "impossible to
connect with blog" in case of error, but the user still gets a long time
waiting the page to load. So I need two things, that I have no idea about
how to reach:

First, load the entire site, and load the blog feeds later, maybe changing a
LOADING message with the correct data, but I dont know how to do that.
Second, implement a timeout in that request (httprequest?), with a two
seconds timeout, or something like that.

If someone can point me a direction I ll be very glad.

All the best,
André


 
Reply With Quote
 
 
 
 
S. Justin Gengo
Guest
Posts: n/a
 
      02-12-2010
André,

I think you're looking for:
XDocument.QueryAdapter.Timeout

--


Sincerely,

S. Justin Gengo, MCP

Free code library at:
http://www.aboutfortunate.com

"Out of chaos comes order."
Nietzsche

"André Freitas" <andrefreitas> wrote in message
news:...
> Im using a xDocument with Linq to get the last 10 blog entries. Like this:
>
> XDocument xDocument = XDocument.Load("SOMEURL");
> var linq =
> from itens in xDocument.Root.Elements("channel").Elements("item" ).Take(10)
> select new
> {
> title = (string)itens.Element("title"),
> link = (string)itens.Element("link")
> };
> rptBlogFeed.DataSource = linq;
> rptBlogFeed.DataBind();
>
> The problem: I already got the blog feed (third-apart) offline a few
> times, and when it ocours, if the site is not cached, the user gets a
> error. I have encapsulated the code in a TRY clause, and Im returning a
> "impossible to connect with blog" in case of error, but the user still
> gets a long time waiting the page to load. So I need two things, that I
> have no idea about how to reach:
>
> First, load the entire site, and load the blog feeds later, maybe changing
> a LOADING message with the correct data, but I dont know how to do that.
> Second, implement a timeout in that request (httprequest?), with a two
> seconds timeout, or something like that.
>
> If someone can point me a direction I ll be very glad.
>
> All the best,
> André
>

 
Reply With Quote
 
 
 
 
André Freitas
Guest
Posts: n/a
 
      02-12-2010
I cant found the property in XDocument MSDN library.

André

"S. Justin Gengo" <> escreveu na mensagem
news:%23PWysh$...
> André,
>
> I think you're looking for:
> XDocument.QueryAdapter.Timeout
>
> --
>
>
> Sincerely,
>
> S. Justin Gengo, MCP
>
> Free code library at:
> http://www.aboutfortunate.com
>
> "Out of chaos comes order."
> Nietzsche
>
> "André Freitas" <andrefreitas> wrote in message
> news:...
>> Im using a xDocument with Linq to get the last 10 blog entries. Like
>> this:
>>
>> XDocument xDocument = XDocument.Load("SOMEURL");
>> var linq =
>> from itens in
>> xDocument.Root.Elements("channel").Elements("item" ).Take(10)
>> select new
>> {
>> title = (string)itens.Element("title"),
>> link = (string)itens.Element("link")
>> };
>> rptBlogFeed.DataSource = linq;
>> rptBlogFeed.DataBind();
>>
>> The problem: I already got the blog feed (third-apart) offline a few
>> times, and when it ocours, if the site is not cached, the user gets a
>> error. I have encapsulated the code in a TRY clause, and Im returning a
>> "impossible to connect with blog" in case of error, but the user still
>> gets a long time waiting the page to load. So I need two things, that I
>> have no idea about how to reach:
>>
>> First, load the entire site, and load the blog feeds later, maybe
>> changing a LOADING message with the correct data, but I dont know how to
>> do that.
>> Second, implement a timeout in that request (httprequest?), with a two
>> seconds timeout, or something like that.
>>
>> If someone can point me a direction I ll be very glad.
>>
>> All the best,
>> André
>>



 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
how to implement timeout on vista Li Chen Ruby 2 10-28-2008 10:24 PM
How to implement signal.wait(timeout) ? Jacob Ruby 2 10-01-2008 11:08 AM
How can I implement a timeout with subprocess.Popen()? I. Myself Python 0 05-01-2006 01:35 AM
Timeout::timeout and Socket timeout Mark Probert Ruby 1 10-06-2004 09:30 AM
Re: Timeout expired. The timeout period elapsed prior to completion of the operation or the server is not responding. Bob Johnson ASP .Net 0 08-07-2003 12:52 PM



Advertisments
 



1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57