Click here to Skip to main content
15,913,685 members
Home / Discussions / ASP.NET
   

ASP.NET

 
GeneralRe: Persist a dataset across postbacks Pin
tonymathewt5-Nov-09 1:29
professionaltonymathewt5-Nov-09 1:29 
AnswerRe: Persist a dataset across postbacks Pin
Shameel3-Nov-09 2:09
professionalShameel3-Nov-09 2:09 
GeneralRe: Persist a dataset across postbacks Pin
tonymathewt5-Nov-09 0:37
professionaltonymathewt5-Nov-09 0:37 
AnswerRe: Persist a dataset across postbacks Pin
Abhishek Sur3-Nov-09 3:55
professionalAbhishek Sur3-Nov-09 3:55 
GeneralRe: Persist a dataset across postbacks Pin
tonymathewt5-Nov-09 18:01
professionaltonymathewt5-Nov-09 18:01 
GeneralRe: Persist a dataset across postbacks Pin
Abhishek Sur5-Nov-09 20:35
professionalAbhishek Sur5-Nov-09 20:35 
QuestionException are Generated in Database Pin
Johndas3-Nov-09 0:54
Johndas3-Nov-09 0:54 
AnswerRe: Exception are Generated in Database Pin
Abhishek Sur3-Nov-09 4:12
professionalAbhishek Sur3-Nov-09 4:12 
QuestionHow can I send email to 100000 persons? [modified] Pin
m-khansari3-Nov-09 0:46
m-khansari3-Nov-09 0:46 
AnswerRe: How can I send email to 100000 persons? Pin
Ashfield3-Nov-09 1:30
Ashfield3-Nov-09 1:30 
GeneralRe: How can I send email to 100000 persons? Pin
m-khansari3-Nov-09 19:39
m-khansari3-Nov-09 19:39 
GeneralRe: How can I send email to 100000 persons? Pin
Ashfield4-Nov-09 7:25
Ashfield4-Nov-09 7:25 
AnswerRe: How can I send email to 100000 persons? Pin
Shameel3-Nov-09 2:13
professionalShameel3-Nov-09 2:13 
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 

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.