I’ve learned asp.net from books available on the internet, but I didn’t find a good book that teaches you some techniques or logic to follow to build an administration area to control the front-end.
I mean they talked about security, membership and roles. but still they didn’t show you how to manage anything that’s not related to a database, anything that’s related to a database you’ll probably create a page to display some info from a db with some SELECT commands and another page for the admin to INSERT, DELETE, UPDATE
but how can I connect to the other controls from my admin panel.
for example : a textbox in the admin.aspx will edit the value of a certain label in display.aspx
another example : I built a web user control to retrieve articles from a DB and another control to be placed in the admin page, which will let the admin add new articles and it will insert it to the database, how can I add more power to the admin page to control the number articles to display on the page, or to control the sorting of the articles, etc…
If i could get a name of a book that helps me with the logic or basics of creating a page that works like my admin panel to control the front-end it would be great, if not! some ideas or articles would help
Thanks for your time and help in advance =)
You need to insert Controls into your admin area, where you can enter the desired values.
E.g.
Afterwards you somehow need to store them, e.g. in a database.
In the client page you can then retrieve that value from the database and assign it to the corresponding control. E.g. with a GridView
Edit:
You probably need to learn more about the asp.net lifecycle. Finding controls of the current page and the masterpage works, but from another page does not work, because it is only created upon execution. You won’t be able to change these values in the admin area, because these values need to be stored permanently, so that everyone will be able to see the pages with the settings you desired indenpendently of the time they call the page.
There is a “built-in” way by storing the Settings in the so called Application Cache http://msdn.microsoft.com/en-us/library/ms178597.aspx, but this cache only persists as long as the application is running (e.g. in the IIS). Once the application resets, are your changes are lost and you would need to make them again. What is why it is so important to have a persistent way of storing such settings, unless you like to babysit your application everytime it restarts (e.g. server restart in the middle of the night)