Click here to Skip to main content
15,881,852 members
Home / Discussions / ASP.NET
   

ASP.NET

 
GeneralRe: How can I send email to 100000 persons? Pin
m-khansari3-Nov-09 19:40
m-khansari3-Nov-09 19:40 
QuestionText Changed and javascript confirm box Pin
gbabu173-Nov-09 0:23
gbabu173-Nov-09 0:23 
AnswerRe: Text Changed and javascript confirm box Pin
Abhishek Sur3-Nov-09 0:59
professionalAbhishek Sur3-Nov-09 0:59 
GeneralRe: Text Changed and javascript confirm box Pin
gbabu173-Nov-09 1:06
gbabu173-Nov-09 1:06 
GeneralRe: Text Changed and javascript confirm box Pin
Abhishek Sur3-Nov-09 3:47
professionalAbhishek Sur3-Nov-09 3:47 
QuestionSum of row value in Microsoft Report Viewer Pin
sandhya143-Nov-09 0:21
sandhya143-Nov-09 0:21 
AnswerRe: Sum of row value in Microsoft Report Viewer Pin
sashidhar3-Nov-09 0:54
sashidhar3-Nov-09 0:54 
Questionsitemappath is not showing sub categories... Pin
RajpootRohan2-Nov-09 23:34
professionalRajpootRohan2-Nov-09 23:34 
Hello friends,

I am developing a shopping cart. I need a sitemappath in this. I implemented the code but the problem is that I have a categories table from which the sitemappath is fetching the data. In these categories some are main categories and some are their sub categories. For Example I am having a category structure like this:

Glassware>>Beer Glass>>Universal Beer Glass...

When I click on glassware, my sitemap shows like this: Home:Glassware

Then after that when I click on Beer Glass, the sitemappath disappears. ie the sitemappath is shown till I have one sub-level.

I did like this:



Please assist me....


public void GenerateXMLFile(string sFileName)
{
    SqlConnection con = new SqlConnection(ConfigurationManager.ConnectionStrings["newcon"].ConnectionString);
    SqlCommand cmd = new SqlCommand("select * from CATEGORY ", con);
    //SqlCommand cmd1 = new SqlCommand("select * from PRODUCTS ",con);
    cmd.Connection.Open();
    //cmd1.Connection.Open();

    SqlDataReader reader1 = cmd.ExecuteReader();

    //Create XML

    Encoding enc = Encoding.UTF8;
    XmlTextWriter objXMLTW = new XmlTextWriter(sFileName, enc);
    try
    {
        objXMLTW.WriteStartDocument();//xml document open

        //'Top level (Parent element)
        //root node open
        objXMLTW.WriteStartElement("siteMap");

        //first Node of the Menu open
        objXMLTW.WriteStartElement("siteMapNode");

        //Title attribute set
        objXMLTW.WriteAttributeString("title", "Home");
        objXMLTW.WriteAttributeString("description", "This is home");//Description attribute set
        objXMLTW.WriteAttributeString("url", "~/index.aspx");//URL attribute set

        //Loop and create nodes

        while (reader1.Read())
        {
            int MasterID = reader1.GetInt32(0);
            objXMLTW.WriteStartElement("siteMapNode");
            objXMLTW.WriteAttributeString("title", reader1.GetString(1));
            objXMLTW.WriteAttributeString("description", reader1.GetString(5));
            objXMLTW.WriteAttributeString("url", reader1.GetString(11));


            objXMLTW.WriteEndElement();//Close the siteMapNode
        }
        objXMLTW.WriteEndElement();//Close the first siteMapNode
        objXMLTW.WriteEndDocument();//xml document closed
    }
    finally
    {
        objXMLTW.Flush();
        objXMLTW.Close();
        //cmd1.Connection.Close();
        cmd.Connection.Close();
    }
}


cheers,
sneha

AnswerRe: sitemappath is not showing sub categories... Pin
Nishant Singh2-Nov-09 23:44
Nishant Singh2-Nov-09 23:44 
QuestionHttp Modules Pin
Nishant Singh2-Nov-09 22:37
Nishant Singh2-Nov-09 22:37 
AnswerRe: Http Modules Pin
Abhishek Sur2-Nov-09 23:56
professionalAbhishek Sur2-Nov-09 23:56 
QuestionPDF Pin
sharmilajv2-Nov-09 21:49
sharmilajv2-Nov-09 21:49 
AnswerRe: PDF Pin
Christian Graus2-Nov-09 21:56
protectorChristian Graus2-Nov-09 21:56 
GeneralRe: PDF Pin
sharmilajv2-Nov-09 22:04
sharmilajv2-Nov-09 22:04 
GeneralRe: PDF Pin
Christian Graus2-Nov-09 22:06
protectorChristian Graus2-Nov-09 22:06 
QuestionUnable to access ASP.Net site Pin
Khaja A. Imtiaz2-Nov-09 21:09
Khaja A. Imtiaz2-Nov-09 21:09 
AnswerRe: Unable to access ASP.Net site Pin
Christian Graus2-Nov-09 21:17
protectorChristian Graus2-Nov-09 21:17 
AnswerRe: Unable to access ASP.Net site Pin
Abhishek Sur2-Nov-09 21:29
professionalAbhishek Sur2-Nov-09 21:29 
AnswerRe: Unable to access ASP.Net site Pin
Vimalsoft(Pty) Ltd2-Nov-09 21:46
professionalVimalsoft(Pty) Ltd2-Nov-09 21:46 
GeneralRe: Unable to access ASP.Net site Pin
Khaja A. Imtiaz2-Nov-09 22:13
Khaja A. Imtiaz2-Nov-09 22:13 
GeneralRe: Unable to access ASP.Net site Pin
Vimalsoft(Pty) Ltd2-Nov-09 22:14
professionalVimalsoft(Pty) Ltd2-Nov-09 22:14 
GeneralRe: Unable to access ASP.Net site Pin
Khaja A. Imtiaz2-Nov-09 22:18
Khaja A. Imtiaz2-Nov-09 22:18 
GeneralRe: Unable to access ASP.Net site Pin
Khaja A. Imtiaz2-Nov-09 22:20
Khaja A. Imtiaz2-Nov-09 22:20 
QuestionRequest.Querystring "undefined" Pin
garfield1852-Nov-09 20:47
garfield1852-Nov-09 20:47 
AnswerRe: Request.Querystring "undefined" Pin
Christian Graus2-Nov-09 20:49
protectorChristian Graus2-Nov-09 20:49 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.