Click here to Skip to main content
15,891,423 members
Home / Discussions / ASP.NET
   

ASP.NET

 
GeneralRe: Protect XML from outside access in asp.net Pin
Prasanta_Prince26-May-11 22:59
Prasanta_Prince26-May-11 22:59 
QuestionSafe logout in asp.net Pin
Ranjani krishnamurthy26-May-11 18:06
Ranjani krishnamurthy26-May-11 18:06 
AnswerRe: Safe logout in asp.net Pin
Blue_Boy26-May-11 21:19
Blue_Boy26-May-11 21:19 
AnswerRe: Safe logout in asp.net Pin
Monjurul Habib27-May-11 9:04
professionalMonjurul Habib27-May-11 9:04 
QuestionSetting Environment Variables Pin
indian14326-May-11 13:01
indian14326-May-11 13:01 
AnswerRe: Setting Environment Variables Pin
R. Giskard Reventlov26-May-11 23:09
R. Giskard Reventlov26-May-11 23:09 
GeneralRe: Setting Environment Variables Pin
indian14327-May-11 5:52
indian14327-May-11 5:52 
QuestionFilter RSS Feeds by Keywords Using LINQ to XML Pin
Dominick Marciano26-May-11 12:48
professionalDominick Marciano26-May-11 12:48 
My page currently displays the five most recent feeds off a site. However I would like to try and filter the feeds based on keywords that are in the description field. My code right now for downloading the feed and binding it to a repeater is:
Dim rssHUDPressDoc As XDocument = XDocument.Load("http://www.hud.gov/news/hudrss.xml")
Dim pressPosts = From item In rssHUDPressDoc.Descendants("item") _
                 Take 5 _
                 Select Title = item.Element("title").Value, _
                 link = item.Element("link").Value, _
                 description = item.Element("description").Value, _
                 pubDate = item.Element("pubDate").Value
If pressPosts.Count = 0 Then
      lblNoPress.Visible = True
Else
      rssHUDPress.DataSource = pressPosts
      rssHUDPress.DataBind()
End If


The above code returns the feeds just fine and I'm able to display it with no problem. However I'm trying to do something to the effect that if I have a string array of keywords:
Dim keywords() as string = new string(){"keyword1","keyword2","keyword3"}


I can change the LINQ statement to something like this:
Dim pressPosts = From item In rssHUDPressDoc.Descendants("item") _
                 Take 5 _
                 Where item.Element("description").Value.ToString.Contains(keywords)
                 Select Title = item.Element("title").Value, _
                 link = item.Element("link").Value, _
                 description = item.Element("description").Value, _
                 pubDate = item.Element("pubDate").Value


However the .Contains() method only accepts a single string, not an array. Currently I need to filter by multiple keywords that apply to our industry and I'm trying to avoid writing numerous OrElse statements within the Where clause. Any suggestions on how I can do this?

Thanks in advance for any help. Been working on this problem for two days now and I can't think of what else to try.
QuestionHow to call back to a VBS file or EXE from the Menu control? [modified] Pin
Jun Du26-May-11 5:36
Jun Du26-May-11 5:36 
AnswerRe: How to call back to a VBS file or EXE from the Menu control? Pin
Dalek Dave1-Jun-11 22:29
professionalDalek Dave1-Jun-11 22:29 
Questionauthenticate particular page in a directory to particular user or role Pin
Asif Rehman26-May-11 3:30
Asif Rehman26-May-11 3:30 
AnswerRe: authenticate particular page in a directory to particular user or role Pin
Orcun Iyigun26-May-11 6:45
Orcun Iyigun26-May-11 6:45 
QuestionEventValidation between v1.1 and 2.0 Pin
bryanforst26-May-11 0:39
bryanforst26-May-11 0:39 
AnswerRe: EventValidation between v1.1 and 2.0 Pin
Orcun Iyigun26-May-11 7:11
Orcun Iyigun26-May-11 7:11 
QuestionCan i ristrict a perticular page to not to resize in a website. Pin
saxenaabhi625-May-11 14:37
saxenaabhi625-May-11 14:37 
AnswerRe: Can i ristrict a perticular page to not to resize in a website. Pin
Not Active25-May-11 15:38
mentorNot Active25-May-11 15:38 
GeneralRe: Can i ristrict a perticular page to not to resize in a website. Pin
saxenaabhi625-May-11 15:46
saxenaabhi625-May-11 15:46 
QuestionHow do I get a hidden input value to refer to a text box? Pin
Dave Clark QED25-May-11 12:05
Dave Clark QED25-May-11 12:05 
AnswerRe: How do I get a hidden input value to refer to a text box? Pin
Not Active25-May-11 15:36
mentorNot Active25-May-11 15:36 
GeneralRe: How do I get a hidden input value to refer to a text box? Pin
saxenaabhi625-May-11 15:44
saxenaabhi625-May-11 15:44 
QuestionLogin Control doesnt work Pin
Dmitry Makovetskiy25-May-11 9:00
Dmitry Makovetskiy25-May-11 9:00 
AnswerRe: Login Control doesnt work Pin
Not Active25-May-11 9:28
mentorNot Active25-May-11 9:28 
GeneralRe: Login Control doesnt work Pin
Dmitry Makovetskiy25-May-11 9:35
Dmitry Makovetskiy25-May-11 9:35 
GeneralRe: Login Control doesnt work Pin
Not Active25-May-11 10:08
mentorNot Active25-May-11 10:08 
QuestionI need replace a selected word in the text of textBox not all text I can´t use SelectedText or SelectionLength like windows Form in asp.net Pin
Ricardo Vela25-May-11 7:54
Ricardo Vela25-May-11 7:54 

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.