Reputation: 4015
i have to create an asp.net page dynamically on runtime.
It should work like this:
1) User logs in using <authentication mode="Windows" />
2) A CheckUser(string Username){} will be send to the webservice which connects to a MySQL database and response with true or false.
3) if the checkuser was true the webservice will check in which roles the user is.
4) depending on the roles an aspx page should be dynamically created with different controls and with different content
what's the best way to do it? im working with .NET 2.0
Upvotes: 2
Views: 2990
Reputation: 11111
Create a single aspx page and then when that page is being rendered, check the permissions and turn on/off content as needed. You can build functions on your page as user controls and dynamically load user controls on your page based on those permissions if you want, or you can put content in panels and just show/hide panels as needed. But do this by creating an aspx page as the base like is mentioned above.
Upvotes: 0
Reputation: 416179
Build static pages with dynamic content, rather creating whole pages dynamically out of thin air. Then have the server redirect to the correct page. Use your web.config file to enforce the security.
Upvotes: 5