Velocity Reviews

Velocity Reviews (http://www.velocityreviews.com/forums/index.php)
-   ASP .Net (http://www.velocityreviews.com/forums/f29-asp-net.html)
-   -   DataList example from Prosise yields no output - don't know why (http://www.velocityreviews.com/forums/t109260-datalist-example-from-prosise-yields-no-output-dont-know-why.html)

Richard Lionheart 09-05-2005 12:50 AM

DataList example from Prosise yields no output - don't know why
 
Hi All,

I took the code from Prosise's DataList example and copied judiciously (I
think) into a new WebForm application. I got only a blank user page as
output. I set breakpoints on statements in the Page_Load but none of them
fired. Below is the code from WebForm1.aspx. Any ideas?

Thanks in advance,
Richard

<%@ Page language="c#" Codebehind="WebForm1.aspx.cs" AutoEventWireup="false"
Inherits="TestRepeaterControls.WebForm1" %>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN" >
<HTML>
<HEAD>
<title>WebForm1</title>
<meta name="GENERATOR" Content="Microsoft Visual Studio 7.0">
<meta name="CODE_LANGUAGE" Content="C#">
<meta name="vs_defaultClientScript" content="JavaScript">
<meta name="vs_targetSchema"
content="http://schemas.microsoft.com/intellisense/ie5">
</HEAD>
<body MS_POSITIONING="GridLayout">
<form id="Form1" method="post" runat="server">
<asp:Repeater ID="MyRepeater" RunAt="server">
<ItemTemplate>
<%# Container.DataItem %>
<br>
</ItemTemplate>
</asp:Repeater>
</form>
</body>
</HTML>

<script language="C#" runat="server">
void Page_Load (Object sender, EventArgs e)
{
if (!IsPostBack)
{
string[] beatles = { "John", "Paul", "George", "Ringo" };
MyRepeater.DataSource = beatles;
MyRepeater.DataBind ();
}
}
</script>



Richard Lionheart 09-05-2005 01:45 AM

Re: DataList example from Prosise yields no output - don't know why
 
Sorry Folks,

I misspoke: I said I took the code from Prosise's DataList example. In
fact, I took it from the Repeater example. Nevertheless, I think what I
created should have resulted in some data in the output user window.

There is one thing that might be a problem. I'm running WinXP/SP2 and some
examples I created have lead to a security warning in a bar at the top of
the screen. I didn't see that with this example.

Regards,
Richard




Onin Tayson 09-05-2005 01:47 AM

Re: DataList example from Prosise yields no output - don't know why
 
Try changing AutoEventWireup="false" to AutoEventWireup="true"

HTH,

"Richard Lionheart" <NoOne@Nowhere.net> wrote in message
news:OKw%23cPbsFHA.3732@TK2MSFTNGP11.phx.gbl...
> Hi All,
>
> I took the code from Prosise's DataList example and copied judiciously (I
> think) into a new WebForm application. I got only a blank user page as
> output. I set breakpoints on statements in the Page_Load but none of them
> fired. Below is the code from WebForm1.aspx. Any ideas?
>
> Thanks in advance,
> Richard
>
> <%@ Page language="c#" Codebehind="WebForm1.aspx.cs"
> AutoEventWireup="false" Inherits="TestRepeaterControls.WebForm1" %>
> <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN" >
> <HTML>
> <HEAD>
> <title>WebForm1</title>
> <meta name="GENERATOR" Content="Microsoft Visual Studio 7.0">
> <meta name="CODE_LANGUAGE" Content="C#">
> <meta name="vs_defaultClientScript" content="JavaScript">
> <meta name="vs_targetSchema"
> content="http://schemas.microsoft.com/intellisense/ie5">
> </HEAD>
> <body MS_POSITIONING="GridLayout">
> <form id="Form1" method="post" runat="server">
> <asp:Repeater ID="MyRepeater" RunAt="server">
> <ItemTemplate>
> <%# Container.DataItem %>
> <br>
> </ItemTemplate>
> </asp:Repeater>
> </form>
> </body>
> </HTML>
>
> <script language="C#" runat="server">
> void Page_Load (Object sender, EventArgs e)
> {
> if (!IsPostBack)
> {
> string[] beatles = { "John", "Paul", "George", "Ringo" };
> MyRepeater.DataSource = beatles;
> MyRepeater.DataBind ();
> }
> }
> </script>
>
>




Richard Lionheart 09-05-2005 03:14 AM

Re: DataList example from Prosise yields no output - don't know why
 
Hi Onin,

That did it! Many thanks. I've got a different problem with the DataList
example, but I'' start a separate thread for it. Meanwhile I'll hunt for
documentation on AutoEventWireup.

Regards,
Richard

Tayson" <Leon_Tayson@compaid.com> wrote in message
news:%23ELVDwbsFHA.3908@tk2msftngp13.phx.gbl...
> Try changing AutoEventWireup="false" to AutoEventWireup="true"
>
> HTH,





All times are GMT. The time now is 03:56 AM.

Powered by vBulletin®. Copyright ©2000 - 2013, vBulletin Solutions, Inc.
SEO by vBSEO ©2010, Crawlability, Inc.


1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57