LoginStatus control

It seems like I’m reproducing functionality of the Whidbey framework lately. I also wrote a ASP.NET server control that is similar to the LoginStatus control. It demonstrates the use of the IPostPackEventHandler interface. The one peculiar thing that I had to implement is a GetLoginUrl method that returns the Url of the login page. In Whidbey you can use the extended configuration object model. could think of no other way to get the loginUrl attribute inside the element in the web.config file.

Does anybody know how this could be done in any other way?

Anyway, I’ve included the C# code file for the server control below. You should remove the .txt extension and compile it inside a Class Library project. You could also include a bitmap file for the Toolbox by adding a bitmap file in the project. Set its Action to Embedded Resource. In the LoginStatus.cs file, you must then remove the comment // at the ToolboxBitmap attribute of the LoginStatus class.

Any feedback is appreciated.

LoginStatus.cs.txt (9.63 KB)

Advertisements
This entry was posted in Uncategorized. Bookmark the permalink.

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Google photo

You are commenting using your Google account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s