Showing posts with label dotnet. Show all posts

Difference between website and web application : ASP.NET  

Posted by: Quadtechindia in ,

A "web site" has its code in a special App_Code directory and it's compiled into several DLLs at runtime. A "web application" is precompiled into one single DLL that is built and copied in the Bin directory.

A web site is just a group of all files in a folder and sub folders. There is no project file. All files under the specific folder - including your word documents, text files, images etc are part of the web site.

You have to deploy all files including source files (unless you pre compile them) to the server. Files are compiled dynamically during run time.

In website since there is no project file, there is nothing that you can double click to open the web site in Visual Studio for editing. You have to open Visual Studio first and then open the site from Visual Studio

Terminate a process in task manager  

Posted by: Quadtechindia in

public void terminate()
{
Process[] plist = Process.GetProcesses();
foreach (Process p in plist)
{
try
{
if (p.MainModule.ModuleName.ToUpper() == "WEBDEV.WEBSERVER.EXE")
{
//p.Kill();
}

if (p.MainModule.ModuleName.ToUpper() == "IEXPLORE.EXE")
{
p.Kill();
}
}
catch
{
}

}
}

A potentially dangerous Request.Form value was detected from the client side  

Posted by: Quadtechindia in

If you face such above mentioned error on inserting a value then that value might be containing anchor tags(< or >). If you want to insert these values you have to write

ValidateRequest="false" in page directive (first line of .aspx file)


Example:
<%@ Page Language="C#" AutoEventWireup="true" CodeFile="xyx.aspx.cs" Inherits="xyz" ValidateRequest="false" %>

What is Literal ?  

Posted by: Quadtechindia in

A Literal Web Server control doesn't have any visual appearance on a Web Form but is used to insert literal text into a Web Form. This control makes it possible to add HTML code directly in the code designer window without switching to design view and clicking the HTML button to edit the HTML.
The notable property of this control is the text property which is the text that is inserted into the Web Form.

Example

The following line of code demonstrates that.

Literal1.Text = "Literal Demo"