Programming ASP.NET By Jesse Liberty, Dan Hurwitz The unconfirmed error reports are from readers. They have not yet been approved or disproved by the author or editor and represent solely the opinion of the reader. Here's a key to the markup: [page-number]: serious technical mistake {page-number}: minor technical mistake : important language/formatting problem (page-number): language change or minor formatting problem ?page-number?: reader question or request for clarification This page was updated April 15, 2008. UNCONFIRMED errors and comments from readers: {12} 2nd Paragraph below Figure 2-4; The book states: "The left side of this dialog box allows you to choose the type of project. In Figure 2-5, Visual C# Projects is selected." But the image in Figure 2-5 shows Visual Basic Projects selected Not Visual C#. [17] 3/5 down the page; I kept getting "Type or namespace "Datetime" not found." when compiling the code in Page_Load in C#. After an hour, I finally got it to work replacing DateTime.Now.ToString() with System.DateTime.Now [28] Step #5.; First of all, perhaps the examples should include the full code, as Step 5 did not indictate how one should include the import directive for those of us not using Visual Studio. Secondly, in order for the example to work, I had to add these directives to the top of the aspx: <%@ Page Language="C#"%> <%@import namespace="System.Data.SqlClient" %> <%@import namespace="System.Data" %> I haven't yet figured out how to import individual classes in order just to bring in the System.Data.DataSet and System.Data.DataTable. [29] Example 3-5; There is a comma missing in the first line of Example 3-5. Populating a table in ASP.NET using C# It currently reads: private void Page_Load(Object Source System.EventArgs E) It should read: private void Page_Load(Object Source, System.EventArgs E) {31} example 3-7; need to trim the title string in order to properly compare with owner; otherwise the example doesn't work as shown dim title AS String = drv("ContactTitle").ToString() title = Trim(title) 'added this code if title = "Owner" then ... {pgs 43-44} This code (Example 4-3) does not produce the output shown on page 47 Figure 4-2.; I have even tried using the code downloaded from your website and it still does not echo the input in the textboxes to the table cell on the form. It compiles without a problem. It just doesn't output as you have shown on page 47 Figure 4-2 after entering text in the textboxes. What is the problem? [49,50] Examples 4-5 & 4-6, asp:TextBox control definition; asp:TextBox does not have a "size" property. {85} No period precedes the body class name, but a period is before the other two class names, indicating they are generic classes.; No period precedes the body class name, but a period is before the other two class names, indicating they are generic classes. error: "body" is not class, should be element.Referrence MSDN(VS2005) [103, 104] Page Directive; Readers who use Visual Studio .NET to work on examples 5-25 and 5-26 will experience a problem with the DropDownList not populating. By default, the AutoEventWireup attribute in the Page Directive that is auto-generated is set to "false." It needs to be changed to "true." {103-104}. The DropDownList couldn't be populated in that case. So I had to change the standard function which had a consequence of changing some further code lines. I had to delete IsPostBack procedure to let it operate. See the supplement. <%@ Page language="c#" Codebehind="WebForm1.aspx.cs" AutoEventWireup="false" Inherits="ASPDropDownListe2.WebForm1" %> void Ddl_Init(Object Source, EventArgs E) { string[,] items={{"","0"},{"C++","1"},{"VC++","2"},{"C#","3"}}; int i; for(i=0;i

DropDownList Constructor Example



[273] Last Paragraph or sub (ddlBooks...); Compiler is reporting Description: An error occurred during the compilation of a resource required to service this request. Please review the following specific error details and modify your source code appropriately. Compiler Error Message: BC30506: Handles clause requires a WithEvents variable. Source Error: Line 36: Line 37: Sub ddlBooks_SelectedIndexChanged(ByVal sender as Object, _ Line 38: ByVal e as EventArgs) Handles ddlBooks.SelectedIndexChanged Line 39: Line 40: {338} 1rd paragraph; second line in the HTML code: should be: (433) last line of page (in table 11-4); in description column for Fillmethod.... change from: "Fills a DataDatable..." to: "Fills a DataTable..." {435} Example 11-2 lines 17 and 18 (roughly); In the code for adding items to a list box, the code does not type cast the item being added as a string. It should read: foreach (DataRow datarow in dataTable.Rows) { lblBugs.Items.Add( dataRow["BugID"].ToString() + ": " + dataRow["Description"].ToString() ); } In the book, the code omits the .ToString() at the end of each call to dataRow["foo"] {491} 2nd paragraph; One line in the code example reads as follows: param.Direction = ParameterDirection..Input; The line should read: param.Direction = ParameterDirection.Input; (573) The SeperatorTemplate; The item template... should be The Seperator Template...