Clicky

I have googled this over and over and somehow I am not finding the code I need or I am missing somethign in the code I have viewed...

What I have is a dynamically created list of integers(1, 10, 11, 12, 13,16, 24, 45, 48, 49 etc) from a SQL query and what I need to do is check that the list contains another set of numbers e.g. 1,11,13 OR 13,16,24,45.

The 1st list has to contain ALL values in the 2nd set of integers for the result to be true or positive

How do I do this considering you can only use 1 value to compare with List.Contains???

asked 11/23/2011 07:49

swgdesign's gravatar image

swgdesign ♦♦


8 Answers:
am not asp guy;but if you are looking for this then you can do this n jquery

1:
2:
3:
4:
5:
var theArray=[1, 10, 11, 12, 13,16, 24, 45, 48, 49];
       if(jQuery.inArray(21, theArray) > -1) alert("it's in there"); 


  </script>
link

answered

chaituu's gravatar image

chaituu

link

answered 2011-11-24 at 04:04:30

chaituu's gravatar image

chaituu

I need to do this in .net as I need to set a buttons link dynamically based around the returned value; true or false.

Thanks
link

answered 2011-11-24 at 04:06:54

swgdesign's gravatar image

swgdesign

var flag=true;
var theArray=[1, 10, 11, 12, 13,16, 24, 45, 48, 49];

       if(jQuery.inArray(10, theArray) > -1)
         {
        
            var a =document.createElement("a");
            a.href="ww.dd.com"
            a.innerHTML="ww.dd.com"
            document.body.appendChild(a);
}

  </script>
link

answered 2011-11-24 at 04:11:36

chaituu's gravatar image

chaituu

u can use arraylists in .net for that u can theck this site...

http://msdn.microsoft.com/en-us/library/system.collections.arraylist.indexof%28v=VS.71%29.aspx
link

answered 2011-11-24 at 04:17:21

manjunathub's gravatar image

manjunathub

if you want you can create hyperlinks dynamically using javascript as well.
link

answered 2011-11-24 at 04:17:43

chaituu's gravatar image

chaituu

In the end I just used a case statement as non of those methods worked with my VS solution.
Thanks for the comments.
link

answered 2011-11-24 at 04:17:51

swgdesign's gravatar image

swgdesign

Non of the methods really worked with my code and I wasn't willing to changed what I had already.

link

answered 2011-12-12 at 02:35:22

swgdesign's gravatar image

swgdesign

Your answer
[hide preview]

Follow this question

By Email:

Once you sign in you will be able to subscribe for any updates here

By RSS:

Answers

Answers and Comments

Tags:

Asked: 11/23/2011 07:49

Seen: 283 times

Last updated: 12/16/2011 05:15