473,327 Members | 2,103 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,327 software developers and data experts.

C# Web-App: Passing a string array to a JavaScript function

I have an array of image file names, and I would like to pass them to a JavaScript function for display. Is there anyway I can get the page's codebehind to interact with javascript?
Dec 19 '07 #1
4 6342
Plater
7,872 Expert 4TB
Sure!
You control what's written to the client after all.
Write out the values in the array to the client in the specific spot.
(Perhaps use the AddAttribute() function on an object, like the page/head or something)
Dec 19 '07 #2
So you're saying I can add each entry in the string array as an attribute to the response header? Is there some way to cycle through the attributes such as in a for loop?
Dec 19 '07 #3
Plater
7,872 Expert 4TB
Yes a for loop could be used to itterate through your string[]
Dec 19 '07 #4
Frinavale
9,735 Expert Mod 8TB
So you're saying I can add each entry in the string array as an attribute to the response header? Is there some way to cycle through the attributes such as in a for loop?
You can declare a hidden variable that contains your array in your .NET code using the Page.ClientScript.RegisterHiddenField() method.

Are you able to modify the JavaScript at all?
Dec 19 '07 #5

Sign in to post your reply or Sign up for a free account.

Similar topics

3
by: Edward Principe | last post by:
I'm working on an OpenSource project, and I'm looking for a web designer to write and administer the web site associated with the project. The project is a free (no money involved) project, and...
18
by: Nick | last post by:
Hello, I wanted to know if anybody has any good suggestions of any books or other resources that could teach me how to make good Web graphics and how to use them in HTML to make Web pages look...
2
by: Bodger | last post by:
I have been working in PHP off and on for a few years and like the language. I have been reading a little about frameworks and web controls and what not. I am interested in a more desktop...
0
by: surfunbear | last post by:
I noticed a post that mentioned PHP does a better job of dynamic web content than java and wanted to see what people have to say about that. Also, I saw it mentioned that in PHP you don't have to...
8
by: John Baker | last post by:
Hi: I am URGENTLY in need of some book or web site OR tool that will help me integrate a relatively simple access application into a web page or pages. This is a time recording system (by...
0
by: Erick Lopez | last post by:
When I send my web page to browser in ouput windows recibe this message and the web page the error BC32400 Please Help me Auto-attach to process ' aspnet_wp.exe' on machine 'TABLET'...
5
by: Michael Herman \(Parallelspace\) | last post by:
1. What are some compelling solutions for using Master/Content pages with Web Pages? 2. If a content area has a web part zone with web parts, what is the user experience like when "editting" the...
7
by: Jonas | last post by:
Hi. I'm trying to develop a web custom control that uses a programmatically created treeview. My problem is that I get an exception when I try to render the control. With properties do I have to...
2
by: Jeff | last post by:
Hey asp.net 2.0 My asp.net 2.0 project has got a assembly load problem: Some of my web.config settings: <membership defaultProvider="AH_MembershipProvider" userIsOnlineTimeWindow="15">
3
by: =?Utf-8?B?RGFuZGFuIFpoYW5n?= | last post by:
Now I have a web application, a web service and a SQL Server database. The Web application will invoke the web service, the web service invokes the SQL Server stored procedure. I let the web...
0
by: ryjfgjl | last post by:
ExcelToDatabase: batch import excel into database automatically...
1
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: Vimpel783 | last post by:
Hello! Guys, I found this code on the Internet, but I need to modify it a little. It works well, the problem is this: Data is sent from only one cell, in this case B5, but it is necessary that data...
0
by: jfyes | last post by:
As a hardware engineer, after seeing that CEIWEI recently released a new tool for Modbus RTU Over TCP/UDP filtering and monitoring, I actively went to its official website to take a look. It turned...
0
by: ArrayDB | last post by:
The error message I've encountered is; ERROR:root:Error generating model response: exception: access violation writing 0x0000000000005140, which seems to be indicative of an access violation...
1
by: PapaRatzi | last post by:
Hello, I am teaching myself MS Access forms design and Visual Basic. I've created a table to capture a list of Top 30 singles and forms to capture new entries. The final step is a form (unbound)...
1
by: Defcon1945 | last post by:
I'm trying to learn Python using Pycharm but import shutil doesn't work
0
by: af34tf | last post by:
Hi Guys, I have a domain whose name is BytesLimited.com, and I want to sell it. Does anyone know about platforms that allow me to list my domain in auction for free. Thank you
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome former...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.