use namespace System.Net.Mail;
use this code in send button click oe where ever u want
try
{
SmtpClient sc = new SmtpClient("smtp.gmail.com", 25);
sc.EnableSsl = true;
sc.Credentials = new System.Net.NetworkCredential(TextFrom.Text, textPwd.Text);
sc.Send(TextFrom.Text, TextTo.Text, TextSubject.Text, TextMatter.Text);
Label1.Text = "Your Message sent Successfully";
}
catch
{
Label1.Text = "An Error has occured;Plz Enter Valid data";
}
Sunday, May 31, 2009
Saturday, May 30, 2009
Can we use two different Languages in one website development?
Yes,But we have to follow some rules.
add /App_Code folder to your solution .
make two sub-folders
like:
App_Code
/VB (Your sub folder name)
myClass1.vb (Your class coded in VB)
/CS (Your sub folder name)
myClass2.cs (Your Class coded in C#)
after that go to web.config file
< compilation > <codesubdirectories>compilation
< codeSubDirectories >
< add directoryName="VB" > < "/add" >
< add directoryName="CS"">""<"/add" >
< codeSubDirectories" >
< /compilation >
< codesubdirectories >
< add directoryname="VB" > < /add >
< add directoryname="CS" > </add >
< codesubdirectories >
< /codesubdirectories > < codesubdirectories >
< add directoryname="CS" > </add >
< codesubdirectories >
< /codesubdirectories > < compilation < > codesubdirectories > < add directoryname="VB" > < /add > < add directoryname="CS" > < /add > < codesubdirectories > </codesubdirectories >
< /codesubdirectories >
</compilation >
//Note:You are not required to name them "VB" and "CS"{Sub-folder names} as we did ,You can use whatever name tickles your fancy.
add /App_Code folder to your solution .
make two sub-folders
like:
App_Code
/VB (Your sub folder name)
myClass1.vb (Your class coded in VB)
/CS (Your sub folder name)
myClass2.cs (Your Class coded in C#)
after that go to web.config file
< compilation > <codesubdirectories>compilation
< codeSubDirectories >
< add directoryName="VB" > < "/add" >
< add directoryName="CS"">""<"/add" >
< codeSubDirectories" >
< /compilation >
< codesubdirectories >
< add directoryname="VB" > < /add >
< add directoryname="CS" > </add >
< codesubdirectories >
< /codesubdirectories > < codesubdirectories >
< add directoryname="CS" > </add >
< codesubdirectories >
< /codesubdirectories > < compilation < > codesubdirectories > < add directoryname="VB" > < /add > < add directoryname="CS" > < /add > < codesubdirectories > </codesubdirectories >
< /codesubdirectories >
</compilation >
//Note:You are not required to name them "VB" and "CS"{Sub-folder names} as we did ,You can use whatever name tickles your fancy.
Friday, May 1, 2009
How to set maximum length to Multiline TextBox in ASP.NET 2.0
First of all this is a bug in .net..We cant set MaxLength while property of TextBox is set to Multiline.
We can achieve this by using regular expression validator.
<asp:RegularExpressionValidator ID="MaxLengthValidator" ControlToValidate="AddersTxtbox" Text="Max length is 20" ValidationExpression="^[\s\S]{0,20}$" runat="server" />
We can achieve this by using regular expression validator.
<asp:RegularExpressionValidator ID="MaxLengthValidator" ControlToValidate="AddersTxtbox" Text="Max length is 20" ValidationExpression="^[\s\S]{0,20}$" runat="server" />
Subscribe to:
Comments (Atom)
