Click here to Skip to main content
15,922,155 members
Home / Discussions / C#
   

C#

 
AnswerRe: Debugging a C# MultiThreaded Code Pin
pbraun25-Jul-07 18:38
pbraun25-Jul-07 18:38 
AnswerRe: Debugging a C# MultiThreaded Code Pin
L Henson25-Jul-07 23:00
L Henson25-Jul-07 23:00 
Questiondisplay data from database Pin
shereem khaleel25-Jul-07 13:18
shereem khaleel25-Jul-07 13:18 
AnswerRe: display data from database Pin
Christian Graus25-Jul-07 13:28
protectorChristian Graus25-Jul-07 13:28 
GeneralRe: display data from database Pin
Paul Conrad25-Jul-07 13:41
professionalPaul Conrad25-Jul-07 13:41 
GeneralRe: display data from database Pin
UglyxXXx25-Jul-07 23:14
UglyxXXx25-Jul-07 23:14 
QuestionC# Texture Atlas Generator Question Pin
rcollina25-Jul-07 12:19
rcollina25-Jul-07 12:19 
QuestionHelp Passing ArrayList form C# to Javascript Pin
Sean G. Murphy25-Jul-07 11:36
Sean G. Murphy25-Jul-07 11:36 
I am creating an ArrayList in C# then passing it to a javascript in a webbrowser.
When trying to read values, I keep getting an "undefined" value for the Array item , i.e. sData[3] in the javascript.
If I do an alert(sData.Count) it does display the correct count for the Array.
Everything up to reading the Array works, the select box gets cleared, etc. But then nothing is passed.
Any help would be appreciated.

C# code:
public class MainForm : Form
{

ArrayList SelectDisplay = new ArrayList();
ArrayList SelectData = new ArrayList();


void PassData_BtnClick(object sender, EventArgs e)
{
FillSelectArrays("Start","none");
FillSelectArrays("One Test","one");
FillSelectArrays("Two Test","two");
FillSelectArrays("Three Test","three");
browser.Document.InvokeScript("FillSelectFromArrays", new object[] { ch.Name, SelectDisplay, SelectData });
}

private void FillSelectArrays(string display, string data)
{
//The Arrays are already defined
SelectDisplay.Add(display);
SelectData.Add(data);
}

private void ClearSelectArrays()
{
SelectDisplay.Clear();
SelectData.Clear();
}

html & javascript:




Test Array:
Values Will Appear Here





function FillSelectFromArrays(sName, sDisplay, sData)
{
var stot = document.forms[0][sName]
EmptySelect(stot)
with (stot)
{
//Rewrites the text and values
alert("sData[3] = " + sData[3]);
for(i=0; i < sDisplay.Count; i++)
{
options[i]=new Option(sDisplay[i], sData[i]);
}
options[0].selected=true
}
}

function EmptySelect(sName)
{

var tot = sName.options.length

for (i=0;i<tot;i++)
{
sName.options[i]=null
}

sName.options.length=0;
}





Thanks!
Sean Murphy
"All things great and small start at the same point, the first step."

AnswerRe: Help Passing ArrayList form C# to Javascript Pin
jkersch26-Jul-07 4:43
jkersch26-Jul-07 4:43 
GeneralRe: Help Passing ArrayList form C# to Javascript Pin
Sean G. Murphy26-Jul-07 10:07
Sean G. Murphy26-Jul-07 10:07 
QuestionStoring Connection String information - .net 2.0 [modified] Pin
Rome'25-Jul-07 10:13
Rome'25-Jul-07 10:13 
AnswerRe: Storing Connection String information - .net 2.0 Pin
ekynox25-Jul-07 16:04
ekynox25-Jul-07 16:04 
GeneralRe: Storing Connection String information - .net 2.0 Pin
Rome'25-Jul-07 21:45
Rome'25-Jul-07 21:45 
GeneralRe: Storing Connection String information - .net 2.0 Pin
Rome'26-Jul-07 7:41
Rome'26-Jul-07 7:41 
AnswerRe: Storing Connection String information - .net 2.0 Pin
Luis Alonso Ramos25-Jul-07 16:56
Luis Alonso Ramos25-Jul-07 16:56 
QuestionTab Control Flicker Pin
Justincc25-Jul-07 9:40
professionalJustincc25-Jul-07 9:40 
AnswerRe: Tab Control Flicker Pin
snorkie31-Jul-07 9:17
professionalsnorkie31-Jul-07 9:17 
GeneralRe: Tab Control Flicker Pin
Justincc31-Jul-07 9:19
professionalJustincc31-Jul-07 9:19 
GeneralRe: Tab Control Flicker Pin
snorkie1-Aug-07 3:11
professionalsnorkie1-Aug-07 3:11 
Questionfileupload control Pin
f_coy25-Jul-07 9:26
f_coy25-Jul-07 9:26 
AnswerRe: fileupload control Pin
kubben25-Jul-07 9:33
kubben25-Jul-07 9:33 
GeneralRe: fileupload control Pin
f_coy25-Jul-07 9:50
f_coy25-Jul-07 9:50 
QuestionPoint in an area Pin
eskape1925-Jul-07 8:56
eskape1925-Jul-07 8:56 
AnswerRe: Point in an area Pin
Luc Pattyn25-Jul-07 10:58
sitebuilderLuc Pattyn25-Jul-07 10:58 
GeneralRe: Point in an area Pin
eskape1925-Jul-07 11:17
eskape1925-Jul-07 11:17 

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.