Thursday, July 29, 2010

Reverse a string




<%
sometext = "Hello Everyone!"
response.write(strReverse(sometext))
%>





output>>>>
!enoyrevE olleH

Create an array




<%
Dim famname(5),i
famname(0) = "Jan Egil"
famname(1) = "Tove"
famname(2) = "Hege"
famname(3) = "Stale"
famname(4) = "Kai Jim"
famname(5) = "Borge"

For i = 0 to 5
      response.write(famname(i) & "
")
Next
%>




output>>>
Jan Egil
Tove
Hege
Stale
Kai Jim
Borge

Looping through HTML headers

html>


<%
dim i
for i=1 to 6
   response.write("Heading " & i & "")
next
%>




output is>>

Date and time

<%@ language="javascript" %>


<%
var d=new Date()
var h=d.getHours()

Response.Write("")
Response.Write(d)
Response.Write("
")
if (h<12)
   {
   Response.Write("Good Morning!")
   }
else
   {
   Response.Write("Good day!")
   }
%>



output is>>>>

Wed Jul 28 22:47:47 EDT 2010
Good day!

Format text with HTML tags



<%
response.write("

You can use HTML tags to format the text!

")
%>


<%
response.write("
This text is styled with the style attribute!
")
%>



output is>>>
This text is styled with the style attribute!

Write text using ASP




<%
response.write("Hello World!")
%>


Sunday, July 18, 2010

Sending Email from Gmail

protected void btnSendEmail_Click(object sender, EventArgs e)
{
//Create Mail Message Object with content that you want to send with mail.System.Net.Mail.MailMessage MyMailMessage = new System.Net.Mail.MailMessage("dotnetguts@gmail.com","myfriend@yahoo.com",
"This is the mail subject", "Just wanted to say Hello");

MyMailMessage.IsBodyHtml = false;

//Proper Authentication Details need to be passed when sending email from gmail
System.Net.NetworkCredential mailAuthentication = new
System.Net.NetworkCredential("dotnetguts@gmail.com", "myPassword");

//Smtp Mail server of Gmail is "smpt.gmail.com" and it uses port no. 587
//For different server like yahoo this details changes and you can
//get it from respective server.
System.Net.Mail.SmtpClient mailClient = new System.Net.Mail.SmtpClient("smtp.gmail.com",587);

//Enable SSLmailClient.EnableSsl = true;

mailClient.UseDefaultCredentials = false;

mailClient.Credentials = mailAuthentication;

mailClient.Send(MyMailMessage);
}

Insert data from gridview to database (ASP.NET)

using System;
using System.Web.UI.WebControls;

public partial class _Default : System.Web.UI.Page
{
protected void Page_Load(object sender, EventArgs e)
{
foreach (GridViewRow row in gvTest.Rows)
{
CheckBox box = row.FindControl("cbChecked") as CheckBox;
}
}
protected void btnCGo_Click(object sender, EventArgs e)
{
// Never give a button click event any more responsibility that capturing the click event :)
GetInformationToSave();
}

///
/// Gets the information to save.
///

protected void GetInformationToSave()
{
foreach (GridViewRow row in gvTest.Rows)
{//This condition is added since here we are inserting only the rows which are checked
CheckBox checkbox = (CheckBox)row.FindControl("cbChecked");

// Collect your information below if the checkbox is checked...
if (checkbox.Checked)
{
Label lblFirstName = (Label)row.FindControl("lblFirstName");
Label lblLastName= (Label)row.FindControl("lblLastName");

//After all your information, send to method that is responsible for saving data to databasea
SaveToDatabase(lblFirstName.Text.Trim(), lblLastName.Text.Trim());
}
}
}

///
/// Saves to database.
///

///
The first name.
/// The last name.
protected void SaveToDatabase(string firstName, string lastName)
{
// CODE HERE TO SAVE TO DATABASE. OBVIOUSLY THIS METHOD SHOULD NOT BE IN THE PAGE CODE BEHIND BUT JUST HERE
// TO DEMONSTRATE.
}
}

Thursday, July 15, 2010

ASP.NET 2.0 Features

If you have worked with ASP.NET 1.x versions, you will undoubtedly agree that it was a great product
that provided huge improvements in the way web applications were designed and deployed. If
ASP.NET 1.x was a great product, then what’s wrong with it? Well, nothing, actually, but when developing
software, there is always a trade-off between how much can be done, how many resources you
have, and how much time you have to do it. There is an almost never-ending supply of features you
can add, but at some stage you have to ship the product. You cannot doubt that ASP.NET 1.0 shipped
with an impressive array of features, but the ASP.NET team members are ambitious, and they not only
had plans of their own but also listened to their users. ASP.NET 2.0 addresses the areas that both the
development team and users wanted to improve. The aims of the new version are:

Thursday, June 24, 2010

ASP:SENDING EMAIL

dim str, mailobj
str="Email Metini"
'response.Write str // Gerekirse e-mail string kontrol
set mailobj = server.createobject("CDO.Message")
mailobj.Subject="ASP EMAIL"
mailobj.From="gonderen"
mailobj.To="asp@asp.com.tr"
'mailobj.TextBody = str
mailobj.HTMLBody = str
mailobj.Configuration.Fields.Item("http://schemas.microsoft.com/cdo/configuration/sendusing") = 2
mailobj.Configuration.Fields.Item("http://schemas.microsoft.com/cdo/configuration/smtpserver") = "asp.com.tr"
mailobj.Configuration.Fields.Item("http://schemas.microsoft.com/cdo/configuration/smtpserverport") = 25
mailobj.Configuration.Fields.Item("http://schemas.microsoft.com/cdo/configuration/smtpconnectiontimeout") = 60
mailobj.Configuration.Fields.Update
mailobj.Send
if err.number=0 then
Response.Write "HATA OLUSTU"
else
Response.Write err.number & err.description
end if

Free download microsoft visual studio2010

if you want to free download microsoft software then you are shock to know that it is provided by microsoft......you are not only download the software(win7,sql server,visual studio2010,windows server) but also participate in the exam provided by microsoft.....so take a tour of>>>>>>


http://www.dreamspark.com



to see this site you are shock........

or any other problem then you also send me mail.....

my email id is..

loveheda@gmail.com

Monday, June 21, 2010

First Asp Programe

Now let us have our First ASP.NET program.
Let9s look at both the markup and the C# portions of a simple web forms application that generates a movie

Sunday, June 20, 2010

Quick Start :To ASP.NET

File name extensions
Web applications written with ASP.NET will consist of many files with different file name extensions. The most common are listed here. Native ASP.NET files by default have the extension .aspx (which is, of course, an extension to .asp) or .ascx. Web Services normally have the extension .asmx.Your file names containing the business logic will depend on the language you use. So, for example, a C# file
would have the extension .aspx.cs. You already learned about the configuration file Web.Config.

Architecture of Asp

ASP.NET is based on the fundamental architecture of .NET Framework. Visual studio provide a uniform way to combine the various features of this Architecture.
Architecture is explained form bottom to top in the following discussion.
At the bottom of the Architecture is Common Language Run time. NET Framework common language run time resides on top of the operating system services. The common language runtime loads and executes code that targets the runtime. This code is therefore called managed code. The runtime gives you, for example, the ability for cross-language integration.

Friday, June 18, 2010

Intoduction to Asp.Net

I have seen many tutorials on ASP.NET but most of them starts with coding and writing your first ASP.NET Program. But here I has written this tutorial for explaining why there is a need for ASP.NET when classy ASP is working fine and what are the underlying technology behind ASP.NET, What programming model ASP.NET
Provides to programmers. Now let us get started.ASP.NET is the new offering for Web developers from the Microsoft .It is not simply the next-generation of ASP;
in fact, it is a completely re-engineered and enhanced technology that offers much, much more than traditional.ASP and can increase productivity significantly.
Because it has evolved from ASP, ASP.NET looks very similar to its predecessor9but only at first sight. Some items look very familiar, and they remind us of ASP. But concepts like Web Forms, Web Services, or Server Controls gives ASP.NET the power to build real Web applications.