Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > ASP .Net > DataList example from Prosise yields no output - don't know why

Reply
Thread Tools

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

 
 
Richard Lionheart
Guest
Posts: n/a
 
      09-05-2005
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>


 
Reply With Quote
 
 
 
 
Richard Lionheart
Guest
Posts: n/a
 
      09-05-2005
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



 
Reply With Quote
 
 
 
 
Onin Tayson
Guest
Posts: n/a
 
      09-05-2005
Try changing AutoEventWireup="false" to AutoEventWireup="true"

HTH,

"Richard Lionheart" <(E-Mail Removed)> wrote in message
news:OKw%(E-Mail Removed)...
> 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>
>
>



 
Reply With Quote
 
Richard Lionheart
Guest
Posts: n/a
 
      09-05-2005
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" <(E-Mail Removed)> wrote in message
news:%(E-Mail Removed)...
> Try changing AutoEventWireup="false" to AutoEventWireup="true"
>
> HTH,



 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
findcontrol("PlaceHolderPrice") why why why why why why why why why why why Mr. SweatyFinger ASP .Net 2 12-02-2006 03:46 PM
Learn ASP.NET 2.0 with Jeff Prosise dm1608 ASP .Net 0 01-29-2006 03:01 AM
Problem with method that starts process, yields pid then yields return code x1 Ruby 11 12-06-2005 01:30 AM
Problem running a Jeff Prosise example Richard Lionheart ASP .Net Building Controls 1 10-25-2005 11:16 PM
Setting up a datalist control - Item_DataBound for a datalist in a datalist Nevyn Twyll ASP .Net 8 09-09-2004 10:13 PM



Advertisments