How to run a Web application using the permission of an authenticated user
Use the <identity> element in the web.config <identity impersonate=’true’/>
How to implement authentication via web.config
Include the <authorization> element. <authorization> <deny users=’?’/> </authorization>
Why do I get the Compiler Error Message: ‘CS0246: The type or namespace name ‘…’ could not be found (are you missing a using directive or an assembly reference?) ‘
This problem typically comes when: You do not have class with that name in your project You add the class later on and run the project without compiling You have the class but you do not specify the namespace via Imports or using keyword
How to set the background color of a web page using code behind?
Yes In the body tag, add runat=’server’ and give the tag an id (e.g. id=’bodyID’). In the class definition in the code-behind, add VB.NET Protected bodyID As System.Web.UI.HtmlControls.HtmlGenericControl C# protected System.Web.UI.HtmlControls.HtmlGenericControl bodyID ; In code, use the attributes collection to set the bgcolor attribute: VB.NET bodyID.Attributes.Add(‘bgcolor’, ‘green’) C# bodyID.Attributes.Add(‘bgcolor’, ‘green’);
How to loop through a Dataset to display all records
VB.NET ’Fill Dataset Dim dc As DataColumn Dim dr As DataRow For Each dr In ds.Tables(0).Rows For Each dc In ds.Tables(0).Columns Response.Write(dr(dc.ColumnName).ToString()) Next Next C# //Fill the DataSet foreach (DataRow dr in ds.Tables[0].Rows) { foreach( DataColumn dc in ds.Tables[0].Columns) { Response.Write(dr[dc.ColumnName].ToString()); } }