Validation error

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • mimranp
    New Member
    • Aug 2008
    • 10

    Validation error

    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)
    Code:
    <%@ Page Language="C#" AutoEventWireup="true" CodeFile="Listing.aspx.cs" Inherits="Admin_Category_Listing" %>
    
    <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
    
    <html xmlns="http://www.w3.org/1999/xhtml">
    <head>
        <title>Untitled Page</title>
    </head>
    <body>
    <div>
    <%
        
        //display category 
        Response.Write("<h2>Category Listing Page version 02</h2>");
    
        if (flag01 == false)
        {
            //display error page and exit
            Response.Write("No more child categories.");
    
        }
        else
        {
    
            string CAT_NAME = dsX.Tables["L1_CATEGORY"].Rows[0]["CAT_NAME"].ToString();
            string CAT_ID = dsX.Tables["L1_CATEGORY"].Rows[0]["CAT_ID"].ToString();
            //Response.Write("<li>");
            Response.Write("<ul>");
            Response.Write(CatTemplate.getC002_LIST_LI1_TAG(CAT_ID, "", CAT_NAME, CAT_NAME));
    
            for (int i = 0; i < dsX.Tables["L1_CATEGORY"].Rows.Count; i++)
            {
                //Response.Write("<ol>");
                 Response.Write("<ul>");
                //build child template
                string CHILDCAT_NAME = dsX.Tables["L1_CATEGORY"].Rows[i]["CHILDCAT_NAME"].ToString();
                string CHILDCAT_ID = dsX.Tables["L1_CATEGORY"].Rows[i]["CHILDCAT_ID"].ToString();
    
                //CatTemplate.addChildsC002_LIST(i, 0, CHILDCAT_ID, "", CHILDCAT_NAME, CHILDCAT_NAME);
                Response.Write(CatTemplate.getC002_LIST_LI1_TAG(CHILDCAT_ID, "", CHILDCAT_NAME, CHILDCAT_NAME));            
                //2nd layer of sub categories
                //Response.Write("<ol>");
                Response.Write("<ul>");
                flag01 = oraDA.getCategoryListing(ref dsX1, CHILDCAT_ID);
                for (int j = 0; j < dsX1.Tables["L1_CATEGORY"].Rows.Count; j++)
                {
                    //build child template
                    string CHILDCAT_NAME1 = dsX1.Tables["L1_CATEGORY"].Rows[j]["CHILDCAT_NAME"].ToString();
                    string CHILDCAT_ID1 = dsX1.Tables["L1_CATEGORY"].Rows[j]["CHILDCAT_ID"].ToString();
                   // Response.Write("<ul>");
                    //CatTemplate.addChildsC002_LIST(i, j, CHILDCAT_ID1, "", CHILDCAT_NAME1, CHILDCAT_NAME1);
                    Response.Write(CatTemplate.getC002_LIST_LI2_TAG(CHILDCAT_ID1, "", CHILDCAT_NAME1, CHILDCAT_NAME1));
    
                    //2nd layer of sub categories
                    Response.Write("<ul>");
                    flag01 = oraDA.getCategoryListing(ref dsX2, CHILDCAT_ID1);
                    for (int k = 0; k < dsX2.Tables["L1_CATEGORY"].Rows.Count; k++)
                    {
                        string CHILDCAT_ID2 = dsX2.Tables["L1_CATEGORY"].Rows[k]["CHILDCAT_ID"].ToString();
                        string CHILDCAT_NAME2 = dsX2.Tables["L1_CATEGORY"].Rows[k]["CHILDCAT_NAME"].ToString();
                       //Response.Write("<li>");
                        //Response.Write("<ul>");
                       // Response.Write("<li>");
                        Response.Write(CatTemplate .getC002_LIST_LI1_TAG (CHILDCAT_ID2 ,"",CHILDCAT_NAME2 ,CHILDCAT_NAME2 ));
                        //Response.Write("</li>");
                        //Response.Write("</ul>");
                    }
                    Response.Write("</ul>");
                    dsX2.Clear();
                }
                dsX1.Clear();
                //Response.Write("</ol>");
                Response.Write("</ul>");
                //Response.Write("</ol>");
                Response.Write("</ul>");
              
                         
                
            }
            //build parent template
            Response.Write("</ul>");
            //Response.Write("</li>");
        }
        
        
     %>
     </div>
    </body>
    </html>
    this is aspx page.
    class behind 
    using System;
    using System.Data;
    using System.Configuration;
    using System.Linq;
    using System.Web;
    using System.Web.Security;
    using System.Web.UI;
    using System.Web.UI.HtmlControls;
    using System.Web.UI.WebControls;
    using System.Web.UI.WebControls.WebParts;
    using System.Xml.Linq;
    
    /// <summary>
    /// Summary description for CatTemplate
    /// </summary>
    public static class CatTemplate
    {
        static public string strLink1 = "/Admin/Category/CatMultiAssign_INU.aspx?CAT_ID=";
        const string C001_LIST_01 = @"<p><em><a href=""/admin/category/listing.aspx?CAT_ID=~strLink~"" title=""~strLinkTitle~""><strong>~strCAT_NAME~ </strong></a>
    ----- <a href=""/admin/category/Cat_INC.aspx?CAT_ID=~strLink~"" title=""Add new child category for ~strLinkTitle~""> Add Child </a>|
    <a href=""/admin/category/Cat_INU.aspx?CAT_ID=~strLink~"" title=""Update category ~strLinkTitle~""> Update </a>
    </em></p>";
        const string C002_LIST = @"<li><ul>
    <strong>~strCAT_NAME~ </strong>
    ----- <a href=""/admin/category/Cat_INC.aspx?CAT_ID=~strLink~"" ></a>
    <a href=""/admin/category/Cat_INU.aspx?CAT_ID=~strLink~"" title=""Update category ~strLinkTitle~"">Update</a> | 
    <a href=""/admin/category/listing.aspx?CAT_ID=~strLink~"" title=""List category ~strLinkTitle~"">List</a>
    <ul>
    ~CHILDS~
    </ul>
    </ul></li>";
        const string C002_LIST_CHILDS = @"<li>
    ~strCAT_NAME~ 
    ----- <a href=""/admin/category/Cat_INC.aspx?CAT_ID=~strLink~"" title=""Add new child category for ~strLinkTitle~"">Add Child</a> |
    <a href=""/admin/category/Cat_INU.aspx?CAT_ID=~strLink~"" title=""Update category ~strLinkTitle~"">Update</a> | 
    <a href=""/admin/category/listing.aspx?CAT_ID=~strLink~"" title=""List category ~strLinkTitle~"">List</a>
    </li>";
    
        const string C002_LIST_LI1_TAG = @"
    <li><strong>~strCAT_NAME~ </strong>
    ----- <a href=""/admin/category/Cat_INC.aspx?CAT_ID=~strLink~"" title=""Add new child category for ~strLinkTitle~"">Add Child</a> |
    <a href=""/admin/category/Cat_INU.aspx?CAT_ID=~strLink~"" title=""Update category ~strLinkTitle~"">Update</a> | 
    <a href=""/admin/category/listing.aspx?CAT_ID=~strLink~"" title=""List category ~strLinkTitle~"">List</a>|
    <a href=""/admin/category/CatMultiAssign_INU.aspx?CAT_ID=~strLink~"" title=""Multi Assign category ~strLinkTitle~""> Multi Assign </a></li>";
    
    
        const string C002_LIST_LI2_TAG = @"
    <li>~strCAT_NAME~ 
    ----- <a href=""/admin/category/Cat_INC.aspx?CAT_ID=~strLink~"" title=""Add new child category for ~strLinkTitle~"">Add Child</a> |
    <a href=""/admin/category/Cat_INU.aspx?CAT_ID=~strLink~"" title=""Update category ~strLinkTitle~"">Update</a> | 
    <a href=""/admin/category/listing.aspx?CAT_ID=~strLink~"" title=""List category ~strLinkTitle~"">List</a>|
    <a href=""/admin/category/CatMultiAssign_INU.aspx?CAT_ID=~strLink~"" title=""Multi Assign category ~strLinkTitle~"">Multi Assign</a></li>";
        const string C002_LIST1 = @"
    
    
    <li>
    
    ~strCAT_NAME~
    
    </li>
    
    ";
        const string C002_LIST2 = @"
    <li>~strCAT_NAME~ 
    </a></li>";
    
    
    
    
        //template 001
        static public string getC001_HREF_01(string strLink, string strLinkTitle, string strCAT_NAME, string strCAT_REMARK)
        {
            string strNew;
    
            strNew = C001_LIST_01.Replace("~strLink~", strLink);
            strNew = strNew.Replace("~strLinkTitle~", strCAT_NAME);
            strNew = strNew.Replace("~strCAT_NAME~", strCAT_NAME);
            strNew = strNew.Replace("~strCAT_REMARK~", strCAT_REMARK);
    
    
            return strNew;
        }
        //template 002
    
    
    
        static public string getC002_LIST_LI1_TAG(string strLink, string strLinkTitle, string strCAT_NAME, string strCAT_REMARK)
        {
            string strNew;
            strNew = C002_LIST_LI1_TAG.Replace("~strLink~", strLink);
            strNew = strNew.Replace("~strLinkTitle~", "hello");
            strNew = strNew.Replace("~strCAT_NAME~", strCAT_NAME);
            strNew = strNew.Replace("~strCAT_REMARK~", strCAT_REMARK);
    
            return strNew;
        }
        static public string getC002_LIST_LI2_TAG(string strLink, string strLinkTitle, string strCAT_NAME, string strCAT_REMARK)
        {
            string strNew;
            strNew = C002_LIST_LI2_TAG.Replace("~strLink~", strLink);
            strNew = strNew.Replace("~strLinkTitle~", "hello");
            strNew = strNew.Replace("~strCAT_NAME~", strCAT_NAME);
            strNew = strNew.Replace("~strCAT_REMARK~", strCAT_REMARK);
    
            return strNew;
        }
        static public string getC002_LIST1(string strLink, string strCAT_NAME)
        {
            string strNew;
            strNew = C002_LIST1.Replace(strLink1, strLink);
    
            strNew = strNew.Replace("~strCAT_NAME~", strCAT_NAME);
    
    
            return strNew;
        }
        //static public string getC002_LIST2(string strLink, string strLinkTitle, string strCAT_NAME, string strCAT_REMARK)
        //{
        //    string strNew;
        //    strNew = C002_LIST_LI2_TAG.Replace("~strLink~", strLink);
        //    strNew = strNew.Replace("~strLinkTitle~", "hello");
        //    strNew = strNew.Replace("~strCAT_NAME~", strCAT_NAME);
        //    strNew = strNew.Replace("~strCAT_REMARK~", strCAT_REMARK);
    
        //    return strNew;
        //}
        //static public string getC002_LIST2(string strLink, string strLinkTitle, string strCAT_NAME, string strCAT_REMARK)
        //{
        //    string strNew;
        //    strNew = C002_LIST_LI2_TAG.Replace("~strLink~", strLink);
        //    strNew = strNew.Replace("~strLinkTitle~", "hello");
        //    strNew = strNew.Replace("~strCAT_NAME~", strCAT_NAME);
        //    strNew = strNew.Replace("~strCAT_REMARK~", strCAT_REMARK);
    
        //    return strNew;
        //}
    
    
    
    
    }
    plz help me to correct validation error
    Last edited by acoder; Sep 1 '08, 02:27 PM. Reason: Please use [code] tags
  • drhowarddrfine
    Recognized Expert Expert
    • Sep 2006
    • 7434

    #2
    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.

    Comment

    Working...