Feeds:
Posts
Comments

Archive for January, 2008

It is easy to develop multi language supported web site using ASP.NET . Just follw that step by step.
1.Take a new web site
2.Add “App_GlobalResources” from ASP.NET folders
3.Take a *.resx file (Strings.resx)
4.Enter Name and values
5.Make different *.resx file for different languages and name like that  Strings.en-US.resx (for US english), Strings.fr-FR.resx (for French). Make as many language file you needed
6.Now time for calling and using language from web page
You website Solution Explorer will look like that

globalization.png

Default.aspx file will look like that
<asp:Label ID=”lblName” runat=”server” Text=”Label”></asp:Label>
<asp:Label ID=”lblDesc” runat=”server” Text=”Label”></asp:Label>
<asp:Label ID=”lblComments” runat=”server” Text=”Label”></asp:Label>
<asp:LinkButton ID=”lnkEnglish” runat=”server” OnClick=”lnkEnglish_Click”>English</asp:LinkButton>
<asp:LinkButton ID=”lnkFrench” runat=”server” OnClick=”lnkFrench_Click”>French</asp:LinkButton>
(more…)

Advertisements

Read Full Post »

Send mail using ASP.NET

To send mail from .net 2 classes are available in System.Net.Mail. Classes are MailMessage and SmtpClient . But before coding need to check if Microsoft SMTP service is turned on and prepare to send mail. 

smtp2.png

Setup SMTP Server: Open Internet Services Manager directly or open Computer Management and Navigate to Internet Information Services -> Default SMTP Virtual Server and checkout if the button with the ‘play’ icon on it is disabled, that means it is already started. From properties of Default SMTP virtual server, go to “Access” tab then from “Replay” option add IP “127.0.0.1”, It considers itself being used as a mail relay. (more…)

Read Full Post »

i written a simple code

SmtpClient smtp = new SmtpClient(“localhost”);
smtp.Send(“from@testserver.com”, “to@testrserver.com”, “Test mail subject”, “Test mail body”);

but got exception “Mailbox unavailable. The server response was: 5.7.1 Unable to relay to@servername.com.”.  Problem is not in the code problem is in the configuration of localhost. It considers itself being used as a mail relay and by default it does not allow anyone to do that. It is easy to solve.

1. Go to “Default SMTP Virtual Server” in IIS and then go to properties

2. Select tab “Access”

3. Add ip of localhost “127.0.0.1”

smtp.png

Read Full Post »

In Distributed network architecture ASP has only one Type of Session Management which can be expressed as In-Process Session State.

In .NET architecture ASP.NET Session Management can be done is different ways as
 1.InProc Session Management (Both application and session run under the Same Process)
 2.StateServer Session Management (application and the session run in different processes)
 3.SqlServer Session Management (session is Maintained in sql server database )

Advantage of StateServer is that if though the application is restarted due to any reason the sessions associated with that application will not be destructed but where as in InProc management session state will be lost along with the application. SqlServer mode is similar to out-of-process mode, except that the session data is maintained in a SQL Server.

Here is a good link for with example: http://msdn2.microsoft.com/en-us/library/ms972429.aspx

Read Full Post »

There two type of cookies in ASP.NET
Persistent cookies:  cookies are stored on your computer hard disk.  They stay on your hard disk and can be accessed by web servers until they are deleted or have expired. 
public void SetPersistentCookies(string name, string value){
 HttpCookie cookie = new HttpCookie(name);
 cookie.Value = value;
 cookie.Expires = Convert.ToDateTime(“12/12/2008”);
 Response.Cookies.Add(cookie);}

Non-persistent cookies: cookies are saved only while your web browser is running.  They can be used by a web server only until you close your browser.  They are not saved on your disk.
public void SetNonPersistentCookies(string name, string value){
 HttpCookie cookie = new HttpCookie(name);
 cookie.Value = value;
 Response.Cookies.Add(cookie);}

Read Full Post »

I had a dastabase restored from anohter PC. Now when I database open database I am getting tables available in the database but when i click on database diagram it gives me error.

 ssmsexpress.png

I have got a good solution in technet. Please go through the link to getsolve the problem

http://technet.microsoft.com/en-us/library/ms189279.aspx

Read Full Post »

To introduce Microsoft Expression Blend need to go for some video tutorial. Here are some introduction video tutorial for Expression Blend

1. Video tutorial 1

2. Video tutorial 2

3. Video tutorial 3

Read Full Post »

Older Posts »