Click here to Skip to main content
Rate this: bad
good
Please Sign up or sign in to vote.
See more: C# ASP.NET4.0
.cs page code
public static list<string> abc=new list<string>();
 
I want to access this list on .aspx page in <script> tag to add some content in list using javascript.
Posted 12-Feb-13 23:07pm
Edited 13-Feb-13 9:52am
v2
Comments
Sergey Alexandrovich Kryukov at 13-Feb-13 14:53pm
   
What list in HTML? What are you talking about?
—SA
Dev_ashish at 2-Mar-13 1:57am
   
list means collection classes type....just like.
public static List list_name=new List();
Sergey Alexandrovich Kryukov at 2-Mar-13 20:06pm
   
What you write won't even compile...
—SA
Rate this: bad
good
Please Sign up or sign in to vote.

Solution 1

Hi,
 
When Using Javascript u can create <select> html element By using InnerHTML
 
Example
 
<script>
function Bind()
{
var res="<ul>";
for(int i=1;i<=10;i++)
{
res=+ "< li > Item "+ 1 +"</li>"
}
res=+"</ul>";
document.getElementByID("list").InnerHTML = res;
}
 
</script></select>
  Permalink  
Rate this: bad
good
Please Sign up or sign in to vote.

Solution 2

i am not sure for what you are trying to do , use this in script tag
function GetMyValue(){
    eval("var someVar = " + parseInt<%=this.MyInteger%>"));
    //Do something
}
  Permalink  
v2

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)

  Print Answers RSS
0 OriginalGriff 365
1 Sergey Alexandrovich Kryukov 334
2 CPallini 275
3 DamithSL 230
4 Maciej Los 215
0 OriginalGriff 5,455
1 DamithSL 4,457
2 Maciej Los 3,885
3 Kornfeld Eliyahu Peter 3,480
4 Sergey Alexandrovich Kryukov 3,115


Advertise | Privacy | Mobile
Web04 | 2.8.141216.1 | Last Updated 13 Feb 2013
Copyright © CodeProject, 1999-2014
All Rights Reserved. Terms of Service
Layout: fixed | fluid

CodeProject, 503-250 Ferrand Drive Toronto Ontario, M3C 3G8 Canada +1 416-849-8900 x 100