views:

43

answers:

1

hi friends,

This is a code from my c# web application

<%

var text = File.ReadAllText(@"D:\Program Files\Microsoft Visual Studio 9.0\Common7\IDE\test.html");

            Regex regex = new Regex("href\\s*=\\s*\"([^\"]*)\"", RegexOptions.IgnoreCase);
            MatchCollection matches = regex.Matches(text);
            //Response.Write(matches);
            foreach (Match match in matches)
            {                        Response.Write(match.Groups[1]);                                                     

            }

%>

here [ Response.Write(match.Groups[1]); ] i will get a display of string array in my screen

i want to store this values in an array and have to pass that array to a javascript function

and then have to take each values from that array.

below is my js function

function openNewWindow() { //alert("hello"); var theurl="http://www.gmail.com"; popupWin = window.open(theurl, '_blank', 'menubar, toolbar, location, directories, status, scrollbars, resizable, dependent, width=640, height=480, left=0, top=0') }

Actually that array will store some hyperlinks, eg: http://www.gmail.com, http://www.google.co.in etc.

now i'm giving that hyperlinks manualy in the js variable [ theurl].

i want to pass my array values to this variable...

can any one help me to do this.

if anyone have a code please share it with me.

Thanks

A: 

Just concatenate all those urls with a special character (delimiter) and send that string to the JavaScript as a parameter.

In the JavaScript you can then split the string into urls and use them.

Thanks

Mahesh Velaga