How to check whether postback caused by a Dynamic link button

I have a button control. On click of this button I need to add a Link Button dynamically. The Link Button needs an event handler. Hence the dynamic Link button is first added in the Page_Load and cleared and added again in the button click handler. Please read Dynamic Control’s Event Handler’s Working for understanding the business requirement for this.

How to Show or hide controls based on roles – ASP.NET MVC 4 Razor

I m working on ASP.NET MVC 4 application.I have a dashboard and my users groups will be based on Windows Domain
So I am using WIndows Authentication for authenticating users.
I created sample applications which uses custom authentication by overrides functions AuthorizeAttribute, ActionFilterAttribute . Is this a good approach ?

Remove invalid (disallowed, bad) characters from FileName (or Directory, Folder, File)

I’ve wrote this little method to achieve the goal in the subj., however, is there more efficient (simpler) way of doing this? I hope this can help somebody who will search for this like I did. var fileName = new System.Text.StringBuilder(); fileName.Append("*Bad/ :, Filename,? "); // get rid of invalid chars while (fileName.ToString().IndexOfAny(System.IO.Path.GetInvalidFileNameChars()) > -1) … Read more