Those people who want to create abstraction about database applications that means don't want to care about low level database application I have a nice suggestion for them----use mygeneration tool which can take care of all database operations. Those who are interested with this just visit the following link and download the softyware
http://www.mygenerationsoftware.com
I will continue how to use of mygeneration tool in next some blogs
thanks
Masud (26.06.09)
Friday, June 26, 2009
Saturday, June 20, 2009
How to send email from a website
This is a nice piece of task I get much pleasure. I think this is a very interesting task for a CSE student who is not yet recognized with the technique of sending an email. Let me state the process step by step. There are two sections:
a.Administrative part
b. Developer's part.
Administrative part:
For Administrative part you have to just set the configuration (shown above) in your web configuration (web.config) file. If you do it to the hosting company server's file then no need to think about other thing. But if you want to make local server (your computer) as the mail server then you have to do some other configuration:
1. Open Control Panel
2. Open Administrative tools
3. Select Internet Information Service (IIS)
4.Select Default SMTP>Properties
5. Click Access tab>Relay (Relay Restrictions)>Grant Access for 127.0.0.1
when you are done with this configuration you are ready to write the funtion for sending email. The required configuration is:
<!--Here Mailserver configuration-->
<system.net>
<mailSettings>
<smtp from="test@nochallenge.net">
<network host="localhost"
userName="test@company.net"
password="****"
port="25"
defaultCredentials="false"/>
</smtp>
</mailSettings>
</system.net>
Developer's Part:
As a developer you just have to write a function for sending email.
Here is the code
protected void SendingEMail()
{
string from="test@yahoo.com";
string to="test@gmail.com";
MailMessage msg=new MailMessage(from,to);
msg.Subject="This is test mail";
msg.Body="Please respond if you get this mail";
SmtpClient client=new SmtpClient("localhost");
client.Send(msg);
Response.write("Mail Sent successfully!");
}
thanks
Masud(26.06.09)
a.Administrative part
b. Developer's part.
Administrative part:
For Administrative part you have to just set the configuration (shown above) in your web configuration (web.config) file. If you do it to the hosting company server's file then no need to think about other thing. But if you want to make local server (your computer) as the mail server then you have to do some other configuration:
1. Open Control Panel
2. Open Administrative tools
3. Select Internet Information Service (IIS)
4.Select Default SMTP>Properties
5. Click Access tab>Relay (Relay Restrictions)>Grant Access for 127.0.0.1
when you are done with this configuration you are ready to write the funtion for sending email. The required configuration is:
<!--Here Mailserver configuration-->
<system.net>
<mailSettings>
<smtp from="test@nochallenge.net">
<network host="localhost"
userName="test@company.net"
password="****"
port="25"
defaultCredentials="false"/>
</smtp>
</mailSettings>
</system.net>
Developer's Part:
As a developer you just have to write a function for sending email.
Here is the code
protected void SendingEMail()
{
string from="test@yahoo.com";
string to="test@gmail.com";
MailMessage msg=new MailMessage(from,to);
msg.Subject="This is test mail";
msg.Body="Please respond if you get this mail";
SmtpClient client=new SmtpClient("localhost");
client.Send(msg);
Response.write("Mail Sent successfully!");
}
thanks
Masud(26.06.09)
How to upload an Image to web server
In this blog I am going to discuss about how to upload an image in web server. Before you upload an image to the server at first you have to ensure that the web server gives you exact permission to upload the image. If permission is not set to true and you yourself are the web administrator here then you have to set that permission true by yourself. For that you have to use Plesk File Manager (or probably others) for granting permission.
Use the following steps:
1. Open Plesk file manager for web server (provided by Hosting company)
2. Login as administrator
3. Click edit/modify for a folder
4. For all users grant modify permission for the target folder you want to store in your image files.
5. Logout from the Plesk file Manager.
Now comes the user's task to do. He/she has small parts to do. Use the following steps.
1. Drag and drop FileUpload control from toolbox of visual studio. This control has a Browse button. Clicking this button you can select any file and path will be shown in the textbox of this control.
2. If you want to upload just image then you check file extension for images and allow to upload
3. Now look at the following snippet of code (C#).
protected void uploadImage()
{
try
{
string fileName=FileUpload1.FileName;
string serverPath=Server.MapPath("images/"); /*images is the folder in webserver you want to upload images */
if(FileUpload1.HasFile) /*already uploaded to server*/
{
FileUpload1.SaveAs(serverPath+fileName); /*image saved to web server folder*/
}
else StatusLabel.Text="No Image file selected";
}catch(Exception exc)
{
StatusLabel.Text=exc.Message;
}
}
Use the following steps:
1. Open Plesk file manager for web server (provided by Hosting company)
2. Login as administrator
3. Click edit/modify for a folder
4. For all users grant modify permission for the target folder you want to store in your image files.
5. Logout from the Plesk file Manager.
Now comes the user's task to do. He/she has small parts to do. Use the following steps.
1. Drag and drop FileUpload control from toolbox of visual studio. This control has a Browse button. Clicking this button you can select any file and path will be shown in the textbox of this control.
2. If you want to upload just image then you check file extension for images and allow to upload
3. Now look at the following snippet of code (C#).
protected void uploadImage()
{
try
{
string fileName=FileUpload1.FileName;
string serverPath=Server.MapPath("images/"); /*images is the folder in webserver you want to upload images */
if(FileUpload1.HasFile) /*already uploaded to server*/
{
FileUpload1.SaveAs(serverPath+fileName); /*image saved to web server folder*/
}
else StatusLabel.Text="No Image file selected";
}catch(Exception exc)
{
StatusLabel.Text=exc.Message;
}
}
Making alignment with table
<table border="0" cellspacing="0" cellpadding="0" width="100%">
<tr>
<td align="left">Masud</td>
<td align="left">Assad</td>
<td align="left">Mamun</td>
<td align="left">Sayed</td>
</tr>
<tr>
<td align="right">Shakila</td>
<td align="right">Shamima</td>
<td align="right">Shahnaz</td>
<td align="right">Tonni</td>
</tr>
<tr>
<td align="center">Grand father</td>
<td align="center">Grand Mother</td>
<td align="center">Father</td>
<td align="center">Mother</td>
</td>
</table>
Wednesday, June 17, 2009
Start design with table
If you want to start designing web page the start design with the table control. Nothing can be in a good shape without using table. During my university years, I spent a lot of time to discover that table is the key of all kind of design efficiently and with full control. Those who have little knowledge about HTML language they can easily realize my following code. Just start like this:
A Simple web page design:
<table>
<tr>
<td>First Column</td>
<td>Second Column</td>
<td>Third Colimn</td>
</tr>
</table>
This is a simple page design using a table which has three columns. Now each of these 3 columns can be further nested with other different controls like table, GridView, labels, buttons.....more and more.
However, just start with this ...you will be benifitted I am sure!
Thanks.
Masud (18.06.09)
A Simple web page design:
<table>
<tr>
<td>First Column</td>
<td>Second Column</td>
<td>Third Colimn</td>
</tr>
</table>
This is a simple page design using a table which has three columns. Now each of these 3 columns can be further nested with other different controls like table, GridView, labels, buttons.....more and more.
However, just start with this ...you will be benifitted I am sure!
Thanks.
Masud (18.06.09)
Learn to design web form by coding
Those people are still designing the web pages based upon the design view of Visual studio I think I am suggesting those people to stop that jsut from now and start coding just from now. I was a design-view user of visual studio which made me just a fool with a tool. However, time passed and things changed. I started designing web pages using raw xhtml which made me comfortable with website designing and to be very frank this made faster in design and many things have become clearer of the mark-up language like xhtml. However, my later blogs will contain different tutorials and solutions of the problems I have faced during my job-life.
Thanks.
Masud (17.06.2009)
Subscribe to:
Posts (Atom)