By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
448,583 Members | 1,044 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 448,583 IT Pros & Developers. It's quick & easy.

Validation error

P: 10
Hi all
i m using visual developer 2008 i m using xhtml1.1 in that .i m reciving so much error when check in online input w3 standard(C# language code behind)
Expand|Select|Wrap|Line Numbers
  1. <%@ Page Language="C#" AutoEventWireup="true" CodeFile="Listing.aspx.cs" Inherits="Admin_Category_Listing" %>
  2.  
  3. <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
  4.  
  5. <html xmlns="http://www.w3.org/1999/xhtml">
  6. <head>
  7.     <title>Untitled Page</title>
  8. </head>
  9. <body>
  10. <div>
  11. <%
  12.  
  13.     //display category 
  14.     Response.Write("<h2>Category Listing Page version 02</h2>");
  15.  
  16.     if (flag01 == false)
  17.     {
  18.         //display error page and exit
  19.         Response.Write("No more child categories.");
  20.  
  21.     }
  22.     else
  23.     {
  24.  
  25.         string CAT_NAME = dsX.Tables["L1_CATEGORY"].Rows[0]["CAT_NAME"].ToString();
  26.         string CAT_ID = dsX.Tables["L1_CATEGORY"].Rows[0]["CAT_ID"].ToString();
  27.         //Response.Write("<li>");
  28.         Response.Write("<ul>");
  29.         Response.Write(CatTemplate.getC002_LIST_LI1_TAG(CAT_ID, "", CAT_NAME, CAT_NAME));
  30.  
  31.         for (int i = 0; i < dsX.Tables["L1_CATEGORY"].Rows.Count; i++)
  32.         {
  33.             //Response.Write("<ol>");
  34.              Response.Write("<ul>");
  35.             //build child template
  36.             string CHILDCAT_NAME = dsX.Tables["L1_CATEGORY"].Rows[i]["CHILDCAT_NAME"].ToString();
  37.             string CHILDCAT_ID = dsX.Tables["L1_CATEGORY"].Rows[i]["CHILDCAT_ID"].ToString();
  38.  
  39.             //CatTemplate.addChildsC002_LIST(i, 0, CHILDCAT_ID, "", CHILDCAT_NAME, CHILDCAT_NAME);
  40.             Response.Write(CatTemplate.getC002_LIST_LI1_TAG(CHILDCAT_ID, "", CHILDCAT_NAME, CHILDCAT_NAME));            
  41.             //2nd layer of sub categories
  42.             //Response.Write("<ol>");
  43.             Response.Write("<ul>");
  44.             flag01 = oraDA.getCategoryListing(ref dsX1, CHILDCAT_ID);
  45.             for (int j = 0; j < dsX1.Tables["L1_CATEGORY"].Rows.Count; j++)
  46.             {
  47.                 //build child template
  48.                 string CHILDCAT_NAME1 = dsX1.Tables["L1_CATEGORY"].Rows[j]["CHILDCAT_NAME"].ToString();
  49.                 string CHILDCAT_ID1 = dsX1.Tables["L1_CATEGORY"].Rows[j]["CHILDCAT_ID"].ToString();
  50.                // Response.Write("<ul>");
  51.                 //CatTemplate.addChildsC002_LIST(i, j, CHILDCAT_ID1, "", CHILDCAT_NAME1, CHILDCAT_NAME1);
  52.                 Response.Write(CatTemplate.getC002_LIST_LI2_TAG(CHILDCAT_ID1, "", CHILDCAT_NAME1, CHILDCAT_NAME1));
  53.  
  54.                 //2nd layer of sub categories
  55.                 Response.Write("<ul>");
  56.                 flag01 = oraDA.getCategoryListing(ref dsX2, CHILDCAT_ID1);
  57.                 for (int k = 0; k < dsX2.Tables["L1_CATEGORY"].Rows.Count; k++)
  58.                 {
  59.                     string CHILDCAT_ID2 = dsX2.Tables["L1_CATEGORY"].Rows[k]["CHILDCAT_ID"].ToString();
  60.                     string CHILDCAT_NAME2 = dsX2.Tables["L1_CATEGORY"].Rows[k]["CHILDCAT_NAME"].ToString();
  61.                    //Response.Write("<li>");
  62.                     //Response.Write("<ul>");
  63.                    // Response.Write("<li>");
  64.                     Response.Write(CatTemplate .getC002_LIST_LI1_TAG (CHILDCAT_ID2 ,"",CHILDCAT_NAME2 ,CHILDCAT_NAME2 ));
  65.                     //Response.Write("</li>");
  66.                     //Response.Write("</ul>");
  67.                 }
  68.                 Response.Write("</ul>");
  69.                 dsX2.Clear();
  70.             }
  71.             dsX1.Clear();
  72.             //Response.Write("</ol>");
  73.             Response.Write("</ul>");
  74.             //Response.Write("</ol>");
  75.             Response.Write("</ul>");
  76.  
  77.  
  78.  
  79.         }
  80.         //build parent template
  81.         Response.Write("</ul>");
  82.         //Response.Write("</li>");
  83.     }
  84.  
  85.  
  86.  %>
  87.  </div>
  88. </body>
  89. </html>
  90. this is aspx page.
  91. class behind 
  92. using System;
  93. using System.Data;
  94. using System.Configuration;
  95. using System.Linq;
  96. using System.Web;
  97. using System.Web.Security;
  98. using System.Web.UI;
  99. using System.Web.UI.HtmlControls;
  100. using System.Web.UI.WebControls;
  101. using System.Web.UI.WebControls.WebParts;
  102. using System.Xml.Linq;
  103.  
  104. /// <summary>
  105. /// Summary description for CatTemplate
  106. /// </summary>
  107. public static class CatTemplate
  108. {
  109.     static public string strLink1 = "/Admin/Category/CatMultiAssign_INU.aspx?CAT_ID=";
  110.     const string C001_LIST_01 = @"<p><em><a href=""/admin/category/listing.aspx?CAT_ID=~strLink~"" title=""~strLinkTitle~""><strong>~strCAT_NAME~ </strong></a>
  111. ----- <a href=""/admin/category/Cat_INC.aspx?CAT_ID=~strLink~"" title=""Add new child category for ~strLinkTitle~""> Add Child </a>|
  112. <a href=""/admin/category/Cat_INU.aspx?CAT_ID=~strLink~"" title=""Update category ~strLinkTitle~""> Update </a>
  113. </em></p>";
  114.     const string C002_LIST = @"<li><ul>
  115. <strong>~strCAT_NAME~ </strong>
  116. ----- <a href=""/admin/category/Cat_INC.aspx?CAT_ID=~strLink~"" ></a>
  117. <a href=""/admin/category/Cat_INU.aspx?CAT_ID=~strLink~"" title=""Update category ~strLinkTitle~"">Update</a> | 
  118. <a href=""/admin/category/listing.aspx?CAT_ID=~strLink~"" title=""List category ~strLinkTitle~"">List</a>
  119. <ul>
  120. ~CHILDS~
  121. </ul>
  122. </ul></li>";
  123.     const string C002_LIST_CHILDS = @"<li>
  124. ~strCAT_NAME~ 
  125. ----- <a href=""/admin/category/Cat_INC.aspx?CAT_ID=~strLink~"" title=""Add new child category for ~strLinkTitle~"">Add Child</a> |
  126. <a href=""/admin/category/Cat_INU.aspx?CAT_ID=~strLink~"" title=""Update category ~strLinkTitle~"">Update</a> | 
  127. <a href=""/admin/category/listing.aspx?CAT_ID=~strLink~"" title=""List category ~strLinkTitle~"">List</a>
  128. </li>";
  129.  
  130.     const string C002_LIST_LI1_TAG = @"
  131. <li><strong>~strCAT_NAME~ </strong>
  132. ----- <a href=""/admin/category/Cat_INC.aspx?CAT_ID=~strLink~"" title=""Add new child category for ~strLinkTitle~"">Add Child</a> |
  133. <a href=""/admin/category/Cat_INU.aspx?CAT_ID=~strLink~"" title=""Update category ~strLinkTitle~"">Update</a> | 
  134. <a href=""/admin/category/listing.aspx?CAT_ID=~strLink~"" title=""List category ~strLinkTitle~"">List</a>|
  135. <a href=""/admin/category/CatMultiAssign_INU.aspx?CAT_ID=~strLink~"" title=""Multi Assign category ~strLinkTitle~""> Multi Assign </a></li>";
  136.  
  137.  
  138.     const string C002_LIST_LI2_TAG = @"
  139. <li>~strCAT_NAME~ 
  140. ----- <a href=""/admin/category/Cat_INC.aspx?CAT_ID=~strLink~"" title=""Add new child category for ~strLinkTitle~"">Add Child</a> |
  141. <a href=""/admin/category/Cat_INU.aspx?CAT_ID=~strLink~"" title=""Update category ~strLinkTitle~"">Update</a> | 
  142. <a href=""/admin/category/listing.aspx?CAT_ID=~strLink~"" title=""List category ~strLinkTitle~"">List</a>|
  143. <a href=""/admin/category/CatMultiAssign_INU.aspx?CAT_ID=~strLink~"" title=""Multi Assign category ~strLinkTitle~"">Multi Assign</a></li>";
  144.     const string C002_LIST1 = @"
  145.  
  146.  
  147. <li>
  148.  
  149. ~strCAT_NAME~
  150.  
  151. </li>
  152.  
  153. ";
  154.     const string C002_LIST2 = @"
  155. <li>~strCAT_NAME~ 
  156. </a></li>";
  157.  
  158.  
  159.  
  160.  
  161.     //template 001
  162.     static public string getC001_HREF_01(string strLink, string strLinkTitle, string strCAT_NAME, string strCAT_REMARK)
  163.     {
  164.         string strNew;
  165.  
  166.         strNew = C001_LIST_01.Replace("~strLink~", strLink);
  167.         strNew = strNew.Replace("~strLinkTitle~", strCAT_NAME);
  168.         strNew = strNew.Replace("~strCAT_NAME~", strCAT_NAME);
  169.         strNew = strNew.Replace("~strCAT_REMARK~", strCAT_REMARK);
  170.  
  171.  
  172.         return strNew;
  173.     }
  174.     //template 002
  175.  
  176.  
  177.  
  178.     static public string getC002_LIST_LI1_TAG(string strLink, string strLinkTitle, string strCAT_NAME, string strCAT_REMARK)
  179.     {
  180.         string strNew;
  181.         strNew = C002_LIST_LI1_TAG.Replace("~strLink~", strLink);
  182.         strNew = strNew.Replace("~strLinkTitle~", "hello");
  183.         strNew = strNew.Replace("~strCAT_NAME~", strCAT_NAME);
  184.         strNew = strNew.Replace("~strCAT_REMARK~", strCAT_REMARK);
  185.  
  186.         return strNew;
  187.     }
  188.     static public string getC002_LIST_LI2_TAG(string strLink, string strLinkTitle, string strCAT_NAME, string strCAT_REMARK)
  189.     {
  190.         string strNew;
  191.         strNew = C002_LIST_LI2_TAG.Replace("~strLink~", strLink);
  192.         strNew = strNew.Replace("~strLinkTitle~", "hello");
  193.         strNew = strNew.Replace("~strCAT_NAME~", strCAT_NAME);
  194.         strNew = strNew.Replace("~strCAT_REMARK~", strCAT_REMARK);
  195.  
  196.         return strNew;
  197.     }
  198.     static public string getC002_LIST1(string strLink, string strCAT_NAME)
  199.     {
  200.         string strNew;
  201.         strNew = C002_LIST1.Replace(strLink1, strLink);
  202.  
  203.         strNew = strNew.Replace("~strCAT_NAME~", strCAT_NAME);
  204.  
  205.  
  206.         return strNew;
  207.     }
  208.     //static public string getC002_LIST2(string strLink, string strLinkTitle, string strCAT_NAME, string strCAT_REMARK)
  209.     //{
  210.     //    string strNew;
  211.     //    strNew = C002_LIST_LI2_TAG.Replace("~strLink~", strLink);
  212.     //    strNew = strNew.Replace("~strLinkTitle~", "hello");
  213.     //    strNew = strNew.Replace("~strCAT_NAME~", strCAT_NAME);
  214.     //    strNew = strNew.Replace("~strCAT_REMARK~", strCAT_REMARK);
  215.  
  216.     //    return strNew;
  217.     //}
  218.     //static public string getC002_LIST2(string strLink, string strLinkTitle, string strCAT_NAME, string strCAT_REMARK)
  219.     //{
  220.     //    string strNew;
  221.     //    strNew = C002_LIST_LI2_TAG.Replace("~strLink~", strLink);
  222.     //    strNew = strNew.Replace("~strLinkTitle~", "hello");
  223.     //    strNew = strNew.Replace("~strCAT_NAME~", strCAT_NAME);
  224.     //    strNew = strNew.Replace("~strCAT_REMARK~", strCAT_REMARK);
  225.  
  226.     //    return strNew;
  227.     //}
  228.  
  229.  
  230.  
  231.  
  232. }
  233.  
plz help me to correct validation error
Sep 1 '08 #1
Share this Question
Share on Google+
1 Reply


drhowarddrfine
Expert 5K+
P: 7,435
You say are using xhtml1.1 but your declaration is 1.0. In any case, version 1.1 is to be served as xml but I doubt you are even serving xhtml either (which, in addition, internet explorer can't work with).

What is the error?

Showing us C# code isn't going to help since most people don't have it so you have to show the generated markup.
Sep 1 '08 #2

Post your reply

Sign in to post your reply or Sign up for a free account.