Click here to Skip to main content
13,449,194 members (55,039 online)
Rate this:
Please Sign up or sign in to vote.
See more:
i am working for cms in which the all the pages are created dynamically now the thing is that i have get back all the title from database to the menu strip, now when i click on the page i..e title it has to get content from database where all this contain in the one table of the database i..e how i can redirect to that page dynamically.for this i have written a for it

public partial class menu : System.Web.UI.Page
    protected void Page_Load(object sender, EventArgs e)
        if (!IsPostBack)

    DataSet GetMenuData()
        SqlConnection con = new SqlConnection("Data Source=localhost;Initial Catalog=newdata23;User ID=sa;Password=123");
        SqlDataAdapter dadCats = new SqlDataAdapter("SELECT cms_title FROM cms", con);
        //SqlDataAdapter dadProducts = new SqlDataAdapter("SELECT * FROM Products", con);
        DataSet dst = new DataSet();
        dadCats.Fill(dst, "cms");
        return dst;
    public void PopulateMenu()
        DataSet dst = GetMenuData();
        foreach (DataRow masterRow in dst.Tables["cms"].Rows)
            MenuItem masterItem = new MenuItem((string)masterRow["cms_title"]);

Posted 28-Jan-13 5:52am
Updated 28-Jan-13 6:11am
Sergey Alexandrovich Kryukov 28-Jan-13 19:25pm
At least put a question mark after your question — I almost deleted this post. Please understand: we are haunted by a great number of non-questions, so, if you don't show your question very clearly, there is a chance of accidental removal of it, so you would need to do it again.
jibesh 28-Jan-13 20:13pm
In Addition to Sergeys comment, do not use text word use proper words and statements. not every one here likes to read text words.
DanielSheets 31-Jan-13 15:15pm
Too bad I can't upvote this.

1 solution

Rate this: bad
Please Sign up or sign in to vote.

Solution 1

Please refer links:
1) Link1
2) Link2

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)

  Print Answers RSS
Top Experts
Last 24hrsThis month

Advertise | Privacy |
Web03-2016 | 2.8.180318.3 | Last Updated 30 Jan 2013
Copyright © CodeProject, 1999-2018
All Rights Reserved. Terms of Service
Layout: fixed | fluid

CodeProject, 503-250 Ferrand Drive Toronto Ontario, M3C 3G8 Canada +1 416-849-8900 x 100