|
 |
aspx_beginners thread: HELP CODING
Message #1 by "Nick" <nick@g...> on Fri, 27 Sep 2002 14:17:59 +0700
|
|
dear all ...
i have a simple code, but i dont know why i put in datagrid doesn't work
in my script
for i = 1 to 3
testing.inner += "test " & i & "<br>"
next
in my html tag i using div
<div id=testing runat=server />
if i running the script will show
test 1
test 2
test 3
but when i put my script into datagrid
<asp:datagrid runat=server >
<columns>
<asp:templatecolumn>
<itemtemplate>
<div id=testing runat=server />
</itemtemplate>
</asp:templatecolumn>
</columns>
</asp:datagrid>
the script error that testing is not declare, how to make it not error anymore ??
any one can help me ??
Message #2 by "Rich K" <rich@r...> on Fri, 27 Sep 2002 04:17:22 -0400
|
|
Nick to see the results in the grid you must bind the data to the grid.
give your asp:datagrid an ID="MyDatGrid" and
in the page_load event try the following
....
ArrayList arrValues = new ArrayList();
for i = 1 to 3
arrValues.Add("test" + i);
Next
MyDataGrid.DataSource = arrValues;
MyDataGrid.DataBind();
....
<asp:datagrid ID="MyDatGrid" runat=server >
<columns>
<asp:templatecolumn>
<itemtemplate>
<asp:Label id=testing text=<%# Container.DataItem %> runat=server />
</itemtemplate>
</asp:templatecolumn>
</columns>
</asp:datagrid>
I hope this helps. I didn't test the code.
-----Original Message-----
From: Nick [mailto:nick@g...]
Sent: Friday, September 27, 2002 3:18 AM
To: aspx_beginners
Subject: [aspx_beginners] HELP CODING
dear all ...
i have a simple code, but i dont know why i put in datagrid doesn't work
in my script
for i = 1 to 3
testing.inner += "test " & i & "<br>"
next
in my html tag i using div
<div id=testing runat=server />
if i running the script will show
test 1
test 2
test 3
but when i put my script into datagrid
<asp:datagrid runat=server >
<columns>
<asp:templatecolumn>
<itemtemplate>
<div id=testing runat=server />
</itemtemplate>
</asp:templatecolumn>
</columns>
</asp:datagrid>
the script error that testing is not declare, how to make it not error
anymore ??
any one can help me ??
---
Beginning ASP.NET Databases using VB.NET
http://www.wrox.com/ACON11.asp?ISBN=1861006195
Beginning ASP.NET Databases using C#
http://www.wrox.com/ACON11.asp?ISBN=1861007418
These books look at how we can create data-centric ASP.NET
applications. Requiring some basic knowledge of ASP.NET,
Access and SQL the authors guide you through the process
of connecting and consuming information in a variety of
ways. They are packed full of excellent illustrative code
examples, demonstrating important fundamental principles.
Message #3 by "Nick" <nick@g...> on Fri, 27 Sep 2002 16:06:35 +0700
|
|
it mean i must using the array, how about if my data more than 1000 so i
must create array more 1000 ?
is there any way ? in datagrid i cannt using innerhtml yeh ??
----- Original Message -----
From: "Rich K" <rich@r...>
To: "aspx_beginners" <aspx_beginners@p...>
Sent: Friday, September 27, 2002 3:17 PM
Subject: [aspx_beginners] RE: HELP CODING
>
> Nick to see the results in the grid you must bind the data to the grid.
> give your asp:datagrid an ID="MyDatGrid" and
> in the page_load event try the following
> ....
> ArrayList arrValues = new ArrayList();
> for i = 1 to 3
> arrValues.Add("test" + i);
> Next
> MyDataGrid.DataSource = arrValues;
> MyDataGrid.DataBind();
> ....
> <asp:datagrid ID="MyDatGrid" runat=server >
> <columns>
> <asp:templatecolumn>
> <itemtemplate>
> <asp:Label id=testing text=<%# Container.DataItem %> runat=server />
> </itemtemplate>
> </asp:templatecolumn>
> </columns>
> </asp:datagrid>
>
> I hope this helps. I didn't test the code.
>
> -----Original Message-----
> From: Nick [mailto:nick@g...]
> Sent: Friday, September 27, 2002 3:18 AM
> To: aspx_beginners
> Subject: [aspx_beginners] HELP CODING
>
>
> dear all ...
> i have a simple code, but i dont know why i put in datagrid doesn't work
> in my script
> for i = 1 to 3
> testing.inner += "test " & i & "<br>"
> next
>
> in my html tag i using div
> <div id=testing runat=server />
> if i running the script will show
> test 1
> test 2
> test 3
>
> but when i put my script into datagrid
> <asp:datagrid runat=server >
> <columns>
> <asp:templatecolumn>
> <itemtemplate>
> <div id=testing runat=server />
> </itemtemplate>
> </asp:templatecolumn>
> </columns>
> </asp:datagrid>
>
> the script error that testing is not declare, how to make it not error
> anymore ??
> any one can help me ??
>
>
> ---
> Beginning ASP.NET Databases using VB.NET
> http://www.wrox.com/ACON11.asp?ISBN=1861006195
>
> Beginning ASP.NET Databases using C#
> http://www.wrox.com/ACON11.asp?ISBN=1861007418
>
> These books look at how we can create data-centric ASP.NET
> applications. Requiring some basic knowledge of ASP.NET,
> Access and SQL the authors guide you through the process
> of connecting and consuming information in a variety of
> ways. They are packed full of excellent illustrative code
> examples, demonstrating important fundamental principles.
>
>
> ---
> Beginning ASP.NET Databases using VB.NET
> http://www.wrox.com/ACON11.asp?ISBN=1861006195
>
> Beginning ASP.NET Databases using C#
> http://www.wrox.com/ACON11.asp?ISBN=1861007418
>
> These books look at how we can create data-centric ASP.NET
> applications. Requiring some basic knowledge of ASP.NET,
> Access and SQL the authors guide you through the process
> of connecting and consuming information in a variety of
> ways. They are packed full of excellent illustrative code
> examples, demonstrating important fundamental principles.
>
Message #4 by "Rich K" <rich@r...> on Fri, 27 Sep 2002 13:31:22 -0400
|
|
Nick you can bind the data directly to a database query. I just provided an
example that matched your initial example.
>
> Nick to see the results in the grid you must bind the data to the grid.
> give your asp:datagrid an ID="MyDatGrid" and
> in the page_load event try the following
> ....
> ArrayList arrValues = new ArrayList();
> for i = 1 to 3
> arrValues.Add("test" + i);
> Next
> MyDataGrid.DataSource = arrValues;
> MyDataGrid.DataBind();
> ....
> <asp:datagrid ID="MyDatGrid" runat=server >
> <columns>
> <asp:templatecolumn>
> <itemtemplate>
> <asp:Label id=testing text=<%# Container.DataItem %> runat=server />
> </itemtemplate>
> </asp:templatecolumn>
> </columns>
> </asp:datagrid>
>
> I hope this helps. I didn't test the code.
>
> -----Original Message-----
> From: Nick [mailto:nick@g...]
> Sent: Friday, September 27, 2002 3:18 AM
> To: aspx_beginners
> Subject: [aspx_beginners] HELP CODING
>
>
> dear all ...
> i have a simple code, but i dont know why i put in datagrid doesn't work
> in my script
> for i = 1 to 3
> testing.inner += "test " & i & "<br>"
> next
>
> in my html tag i using div
> <div id=testing runat=server />
> if i running the script will show
> test 1
> test 2
> test 3
>
> but when i put my script into datagrid
> <asp:datagrid runat=server >
> <columns>
> <asp:templatecolumn>
> <itemtemplate>
> <div id=testing runat=server />
> </itemtemplate>
> </asp:templatecolumn>
> </columns>
> </asp:datagrid>
>
> the script error that testing is not declare, how to make it not error
> anymore ??
> any one can help me ??
>
>
> ---
> Beginning ASP.NET Databases using VB.NET
> http://www.wrox.com/ACON11.asp?ISBN=1861006195
>
> Beginning ASP.NET Databases using C#
> http://www.wrox.com/ACON11.asp?ISBN=1861007418
>
> These books look at how we can create data-centric ASP.NET
> applications. Requiring some basic knowledge of ASP.NET,
> Access and SQL the authors guide you through the process
> of connecting and consuming information in a variety of
> ways. They are packed full of excellent illustrative code
> examples, demonstrating important fundamental principles.
>
>
> ---
> Beginning ASP.NET Databases using VB.NET
> http://www.wrox.com/ACON11.asp?ISBN=1861006195
>
> Beginning ASP.NET Databases using C#
> http://www.wrox.com/ACON11.asp?ISBN=1861007418
>
> These books look at how we can create data-centric ASP.NET
> applications. Requiring some basic knowledge of ASP.NET,
> Access and SQL the authors guide you through the process
> of connecting and consuming information in a variety of
> ways. They are packed full of excellent illustrative code
> examples, demonstrating important fundamental principles.
>
---
Beginning ASP.NET Databases using VB.NET
http://www.wrox.com/ACON11.asp?ISBN=1861006195
Beginning ASP.NET Databases using C#
http://www.wrox.com/ACON11.asp?ISBN=1861007418
These books look at how we can create data-centric ASP.NET
applications. Requiring some basic knowledge of ASP.NET,
Access and SQL the authors guide you through the process
of connecting and consuming information in a variety of
ways. They are packed full of excellent illustrative code
examples, demonstrating important fundamental principles.
|
|
 |