Skip to main content

Posts

Showing posts from July, 2008

How to use DataBinder.Eval in HyperLink NavigationUrl - ASP.net

I wanted to append page Url with DataBinder.Eval value in ASP.NET hyperlink control on ASP.NET HTML source. I was trying it using many ways and also search for resources on web but I could not find any useful thing. I thought this will help u guys to get an idea about appending two strings. Solution as follows. <asp:HyperLink ID="customerHyperLink" runat="server" Text= '<%# DataBinder.Eval(Container.DataItem, "Name") %>' NavigateUrl='<%# "~/Pages/YourPage.aspx?id=" + DataBinder.Eval(Container.DataItem, "id") %>' ></asp:HyperLink> You can see how I have appended these two value in NavigateUrl property. Hope some one will get the advantage of this post.

How To Implement Forms-Based Authentication in Your ASP.NET Application by Using C# .NET

These days I was so busy to find how to Implement form based authentication in my ASP.net application. I was looking for a resource that I can use on web. I found some and most of them are not that easy to understand. So I though to write an article so then any one can read and get the basic idea from it. I will first explain what is my scenario. I have my own database table to keep user credentials. So I wanted to use it to authenticate the users who are trying to log in. This has nothing more than configuring your Web.config and writing few codes authenticate the user. If you have your own database table to keep user credential, obviously you have a method written to authenticate. We can use this method to validate user and based on the results of this method you can do the authentication part. These are the configuration lines that you have to put in to our Web.config. <authentication mode="Forms"> <authentication mode="Forms"> <forms login

How To: Use Forms Authentication with Active Directory in ASP.NET 2.0

This post will show you how to use forms authentication with Microsoft Active Directory directory service by using the ActiveDirectoryMembershipProvider . To create a Web application with a logon page Start Microsoft Visual Studio® .NET development system, and then create a new ASP.NET Web site called FormsAuthAD. Use Solution Explorer to add a new Web form to the site called Login.aspx. Add a Login control to Login.aspx. By default, this control displays a user name field, a password field, and a Remember me next time checkbox. If the user selects this checkbox, a persistent authentication cookie is created and the user's browser stores the cookie on the user's computer. For security reasons, you should avoid creating persistent authentication cookies; therefore, disable this feature by setting the DisplayRememberMe property of the Login control to false . Note that when a user clicks Login on the Login control, it automatically validates the user by calling the con