What is an Atlas?

Atlas is interesting concept extended form AJAX, integrated in ASP.NET 2.0. It extends the concept of AJAX in 2 different ways. 1.It provides the clide side scripting libraries that enable the developers to create the interactive Uis and allows the remote procedure calls by providing the true OO API’s and Components. 2.It provides the rich integrate server development in ASP.NET 2.0. For further information visit this link.

How to close the browser window on button control click

Method 1. This will cause a postback on button click in response to which we will send some script to close the window. VB.NET Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click Response.Write('<script>window.close();</script>') End Sub C# private void Button1_Click(object sender, System.EventArgs e) { Response.Write('<script>window.close();</script>'); } Method 2. This is preferable since there is no postback involved. Use the Attribute collections i.e use Attributes of button control to add client side JavaScript code VB.NET Button1.Attributes.Add('OnClick', 'window.close();') C# Button1.Attributes.Add('OnClick', 'window.close();');

What is the difference between authentication and authorization

Authentication is the process of identifying and verifying who the client accessing the server is. For example, if you use Windows authentication and are browsing an ASP.NET page from server — ASP.NET/IIS would automatically use NTLM to authenticate you as SYNCFUSION\user1 (for example). Forms based authentication, then you would use an html based forms page to enter username/password — which would then check a database and authenticate you against the username/password in the database. Authorization is the process of determining whether an authenticated user has access to run a particular page within an ASP.NET web application. Specifically, as an application author decide to grant or deny the authenticated user ‘SYNCFUSION\user1’ access to the admin.aspx page. This could be done either by explicitly granting/denying rights based on the username — or use role based mappings to map authenticated users into roles (for example: an administrator might map ‘SYNCFUSION\user1’ into the ‘Power Users’ role) and then grant/deny access based on role names (allowing a degree of abstraction to separate out your authorization policy).

How to filter distinct records from a normal Select query and display in a web control

‘Select distinct <field> from <table>’.This SELECT statement is used to filter out duplicate results from a query’s output. But sometimes the requirement is to use a Stored Procedure which returns the entire data and display the manipulated distinct data in web server control. To do this use SortedList For using SortedList import namespace System.Collections Stored Procedure Create Procedure GetSuppliers AS SELECT * FROM Suppliers GO <asp:DataList id='DataList1' runat='server'> <ItemTemplate> <%#Container.DataItem%> </ItemTemplate> </asp:DataList> VB.NET Dim ds As New DataSet Dim myda As SqlDataAdapter = New SqlDataAdapter('GetSuppliers', 'server=localhost;database=Northwind;uid=sa;pwd=;') myda.SelectCommand.CommandType = CommandType.StoredProcedure myda.Fill(ds, 'Table') Dim slist As SortedList = New SortedList Dim dr As DataRow For Each dr In ds.Tables(0).Rows If Not slist.ContainsValue(dr('Country')) Then slist.Add(dr('Supplierid'), dr('Country')) End If Next DataList1.DataSource = slist.GetValueList DataList1.DataBind() ’In case of Dropdownlist ’DropDownList1.DataSource = slist.GetValueList ’DropDownList1.DataBind() C# DataSet ds = new DataSet(); SqlDataAdapter myda = new SqlDataAdapter('GetSuppliers', 'server=localhost;database=Northwind;uid=sa;pwd=;'); myda.SelectCommand.CommandType = CommandType.StoredProcedure; myda.Fill(ds, 'Table'); SortedList slist = new SortedList(); foreach( DataRow dr in ds.Tables[0].Rows) { if (! slist.ContainsValue(dr['Country'])) { slist.Add(dr['Supplierid'].ToString (), dr['Country'].ToString ()); } } DataList1.DataSource = slist.GetValueList(); DataList1.DataBind(); //In case of DropDownList //DropDownList1.DataSource = slist.GetValueList //DropDownList1.DataBind()