When you started working with ASP.NET 2.0, especially using Visual Studio 2005 and added controls to the web page like a Textbox control you may of have recognized that there are two new properties (attributes) present in almost every control. They are the EnableTheming and ThemeID. Also there are additional attributes for the Page directive [...]
Filed under: ASP.NET, General by Rishav
No Comments »
The Code Written below Makes a Page that allows user to upload file to the Server.
<%@ Page Language=”C#” AutoEventWireup=”true” CodeFile=”Default.aspx.cs” Inherits=”_Default” %>
<!DOCTYPE html PUBLIC “-//W3C//DTD XHTML 1.0 Transitional//EN”
“http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd”>
<script runat=”server”>
protected void UploadButton_Click(object sender, EventArgs e)
{// Specify the path on the server to save the uploaded file to.
String savePath = Server.MapPath(”~/UploadedFiles”);
// Before attempting to perform operations [...]
Filed under: ASP.NET, C# Code, Programming Logic by Rishav
No Comments »
ASP.NET is a unified Web development model that includes the services necessary for you to build enterprise-class Web applications with a minimum of coding. ASP.NET is part of the .NET Framework, and when coding ASP.NET applications you have access to classes in the .NET Framework. You can code your applications in any language compatible with [...]
Filed under: ASP.NET, Definition of Terms, General by Rishav
No Comments »
To show the message box on the client side we need to use the client side scripting language like javascript.
To show a simple message box use the script written below
alert(”message to be dispalyed”);
To show a message with options of yes/no
<script language = “javascript” type = “text/javascript”>function choice
{
choice = confirm(
“are you sure”
)
if(choice)
{
//code when user clicks yes
}
}
</script>
Call [...]
Filed under: ASP.NET, Programming Logic by Rishav
No Comments »
A cookie is a small amount of data that is stored either in a text file on the client file system or in memory in the client browser session. It contains site specific information that the server send to the client along with the page output. Cookies can be temporary or persistent.
You can use cookies [...]
Filed under: ASP.NET, Definition of Terms by Rishav
No Comments »
By default, button controls in ASP.NET pages post back to the same page that contains the button, where you can write an event handler for the post. In most cases this is the desired behavior, but occasionaly you will also want to be able to post to another page in your application. The Server.Transfer method [...]
Filed under: ASP.NET, Definition of Terms by Rishav
No Comments »
The following code shows the implementation of QueryString without any errors.
object ob;
string num;
if (Request.QueryString.Count == 0)
{
// write code for when no query string .passed as
// www.sunitcourier/tracknumber.aspx
}
else
{
ob = Request.QueryString["awbnumber"];
if (ob == null)
{
// write code for when query string is available but not which you require
//www.sunitcourier/tracknumberaspx?name=rishav
}
else
{
// Write Code for when Query String is available
//www.sunitcourier/tracknumber.aspx?awbnumber=123
num = ob.ToString();
}
}
Click here [...]
Filed under: ASP.NET, C# Code by Rishav
No Comments »
If the errors are not properly handled in ASP.NET, it may lead to many unwanted consequences such as some part of the code containg error may be revealed and gives a very bad impression to the user if such thing happens in the web application. So these Errors and Exceptions need to handled very carefully. [...]
Filed under: ASP.NET by Rishav
No Comments »
Both Server.Transfer() and Response.Redirect() method are used for navigation within a website and outside it.
Following are the major differences between them:-
Response.Redirect sends message to the browser saying it to move to some different page, while server.transfer does not send any message to the browser but rather redirects the user directly from the server itself. So [...]
Filed under: ASP.NET, Definition of Terms by Rishav
No Comments »