0
JavaScript in ASP.NET
New Here
,
/t5/dreamweaver-discussions/javascript-in-asp-net/td-p/746481
Dec 31, 2006
Dec 31, 2006
Copy link to clipboard
Copied
hello
I have this simple javascript code:
<script language="JavaScript" type="text/javascript">
var Emp = new String(3);
Emp[0] = fname;
Emp[1] = mname;
Emp[2] = lname;
</script>
the question is : how to give values to fname, mname, lname from a database table using asp.net? ( table contains : Fname,MName,LName)
thx alot guys
I have this simple javascript code:
<script language="JavaScript" type="text/javascript">
var Emp = new String(3);
Emp[0] = fname;
Emp[1] = mname;
Emp[2] = lname;
</script>
the question is : how to give values to fname, mname, lname from a database table using asp.net? ( table contains : Fname,MName,LName)
thx alot guys
TOPICS
Server side applications
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting.
Learn more
LEGEND
,
/t5/dreamweaver-discussions/javascript-in-asp-net/m-p/746482#M106050
Dec 31, 2006
Dec 31, 2006
Copy link to clipboard
Copied
As usual, nothing is said about how or when the data is being
retrieved from
the database. Sigh.
Let's say the data is available when the page loads. Thus, HTML controls of
type="hidden" can be populated with the data retrieved from the database
during the page compilation process. The data in the HTML controls can then
be referenced using the document object model in your JavaScript.
<%= Clinton Gallagher
NET csgallagher AT metromilwaukee.com
URL http://clintongallagher.metromilwaukee.com/
MAP http://wikimapia.org/#y=43038073&x=-88043838&z=17&l=0&m=h
"Feras_86" <webforumsuser@macromedia.com> wrote in message
news:en828c$dm$1@forums.macromedia.com...
> hello
> I have this simple javascript code:
>
> <script language="JavaScript" type="text/javascript">
> var Emp = new String(3);
> Emp[0] = fname;
> Emp[1] = mname;
> Emp[2] = lname;
> </script>
>
> the question is : how to give values to fname, mname, lname from a
> database
> table using asp.net? ( table contains : Fname,MName,LName)
> thx alot guys
>
the database. Sigh.
Let's say the data is available when the page loads. Thus, HTML controls of
type="hidden" can be populated with the data retrieved from the database
during the page compilation process. The data in the HTML controls can then
be referenced using the document object model in your JavaScript.
<%= Clinton Gallagher
NET csgallagher AT metromilwaukee.com
URL http://clintongallagher.metromilwaukee.com/
MAP http://wikimapia.org/#y=43038073&x=-88043838&z=17&l=0&m=h
"Feras_86" <webforumsuser@macromedia.com> wrote in message
news:en828c$dm$1@forums.macromedia.com...
> hello
> I have this simple javascript code:
>
> <script language="JavaScript" type="text/javascript">
> var Emp = new String(3);
> Emp[0] = fname;
> Emp[1] = mname;
> Emp[2] = lname;
> </script>
>
> the question is : how to give values to fname, mname, lname from a
> database
> table using asp.net? ( table contains : Fname,MName,LName)
> thx alot guys
>
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting.
Learn more
Feras_86
AUTHOR
New Here
,
/t5/dreamweaver-discussions/javascript-in-asp-net/m-p/746483#M106051
Dec 31, 2006
Dec 31, 2006
Copy link to clipboard
Copied
i wanted to get the first row from a datagrid and pass them
to the java script code :
<script language="JavaScript" type="text/javascript">
var Emp = new String(2);
News[0] = <% dgTop.Items(0).Cells(0).Text() %>; News[1]= <% dgTop.Items(0).Cells(1).Text() %>;
</script>
well i got the following error :
Property access must assign to the property or use its value.
any ideas?
thx alot
<script language="JavaScript" type="text/javascript">
var Emp = new String(2);
News[0] = <% dgTop.Items(0).Cells(0).Text() %>; News[1]= <% dgTop.Items(0).Cells(1).Text() %>;
</script>
well i got the following error :
Property access must assign to the property or use its value.
any ideas?
thx alot
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting.
Learn more
LEGEND
,
LATEST
/t5/dreamweaver-discussions/javascript-in-asp-net/m-p/746484#M106052
Jan 02, 2007
Jan 02, 2007
Copy link to clipboard
Copied
I would suggest that you use a literal field inside of the
javascript and
then you can set the values of the literals as part of either the page load,
or the datagrid selection.
The JS code would look like this
<script language="JavaScript" type="text/javascript">
var Emp = new String(2);
Emp[0] = <asp:Literal id="fname" runat="server" />;
Emp[1] = <asp:Literal id="mname" runat="server" />;
Emp[2] = <asp:Literal id="lname" runat="server" />;
</script>
You would set the literal text value to whatever you were grabbing for
example
fname.Text = dgTop.Items(0).Cells(0).Text()
--
Paul Whitham
Certified Dreamweaver MX2004 Professional
Adobe Community Expert - Dreamweaver
Valleybiz Internet Design
www.valleybiz.net
"Feras_86" <webforumsuser@macromedia.com> wrote in message
news:en9q1k$roo$1@forums.macromedia.com...
>i wanted to get the first row from a datagrid and pass them to the java
> script code :
> <script language="JavaScript" type="text/javascript">
> var Emp = new String(2);
>
> News[0] = <%
> dgTop.Items(0).Cells(0).Text() %>; News[1]= <%
> dgTop.Items(0).Cells(1).Text() %>;
> </script>
>
> well i got the following error :
> Property access must assign to the property or use its value.
>
> any ideas?
> thx alot
>
>
then you can set the values of the literals as part of either the page load,
or the datagrid selection.
The JS code would look like this
<script language="JavaScript" type="text/javascript">
var Emp = new String(2);
Emp[0] = <asp:Literal id="fname" runat="server" />;
Emp[1] = <asp:Literal id="mname" runat="server" />;
Emp[2] = <asp:Literal id="lname" runat="server" />;
</script>
You would set the literal text value to whatever you were grabbing for
example
fname.Text = dgTop.Items(0).Cells(0).Text()
--
Paul Whitham
Certified Dreamweaver MX2004 Professional
Adobe Community Expert - Dreamweaver
Valleybiz Internet Design
www.valleybiz.net
"Feras_86" <webforumsuser@macromedia.com> wrote in message
news:en9q1k$roo$1@forums.macromedia.com...
>i wanted to get the first row from a datagrid and pass them to the java
> script code :
> <script language="JavaScript" type="text/javascript">
> var Emp = new String(2);
>
> News[0] = <%
> dgTop.Items(0).Cells(0).Text() %>; News[1]= <%
> dgTop.Items(0).Cells(1).Text() %>;
> </script>
>
> well i got the following error :
> Property access must assign to the property or use its value.
>
> any ideas?
> thx alot
>
>
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting.
Learn more

