hi
i have a table for store information my page called (tbl_Page) with this fields :
ID - Name - Title - KeyWord - Content
now i want create a list with html (
please help me how to create it
thanks
hi
i have a table for store information my page called (tbl_Page) with this fields :
ID - Name - Title - KeyWord - Content
now i want create a list with html (
please help me how to create it
thanks
Know the answer? Post it. Somebody with the same question will find it here.
Answer a question in the forums and earn +20 SHARP for every answer.
See unanswered questions
DevSocialUpcoming · 3rd editionAI Agents ConferenceDec 1–3, 2026Live onlineFree to attend5days leftRegister
Anil KumarRank #367 · 6.8K reputationPosted May 27, 2012, 7:10 PM EDT
.
Create an object of your data class of tbl_Page OR execute a query and stored it in a datareader which is faster for reading jobs.
Use StringBuilder to append your list into loop. While appending items, you required to give the url of the corresponding page. So corresponding page address/url should be also stored in your tbl_Page table.
SqlCommand myCommand = new SqlCommand( "SELECT Name, PageURL FROM tbl_Page;", myConnection);
myConnection.Open();
SqlDataReader myReader = command.ExecuteReader();
if (myReader !=null && myReader.HasRows)
{
while (myReader.Read())
{
// here you append your list (
}
}
myReader.Close();
OR
You can go for static methods
Jignesh TrivediRank #16 · 50.3K reputationPosted May 27, 2012, 8:09 PM EDT
For same you can use in buit control like Repeater or list view that support in built html.
Other option is create HTML String and add it as child control.
please refer
http://www.ezineasp.net/post/Create-dynamic-tables-using-HtmlControls-HtmlTable.aspx
hope this help.
Vahid Bakhtiary132 reputationPosted May 27, 2012, 10:02 PM EDT
your code are right
but my means how to create dynamic page like CMS
i have a form that get information pages and store in db
for example :
ID Title MetaKeyword Content
1 Home Home
Wellcome to my Site
2 Product product
Categories
now i want create a Menu for them for example :
Home | Product
now when i click on one of them redirect to them
please help me how to creat it
thanks
Jignesh TrivediRank #16 · 50.3K reputationPosted May 28, 2012, 1:28 AM EDT
Ok for same you can use ready made CMS like DNN,Orchard,Composite ect....
please refer
http://webmasterformat.com/blog/top-asp-net-cmss
From that I prefferd DNN(it a freeware).
http://www.dotnetnuke.com/
Also refer
http://www.codeproject.com/Articles/7673/Basic-Content-Management-System-with-ASP-NET-and-M
this link shows how to load dynamic control.
hope this will help you.
Vahid Bakhtiary132 reputationPosted May 28, 2012, 4:50 AM EDT
i try them
iin the end link,the project don't create a new page,and create a id and pass id to default.aspx page
but i want create be aspx page in db no in root my website
please help me how to create dynamic page