08 August 2008


//use this name space.

using System.Net.Mail;


//User this code

MailMessage mail = new MailMessage();

//this is the main line to show friendly name in receiver's inbox.
mail.From = new MailAddress("saaction@myserver.com", "saAction Test Mail");

mail.To.Add("receiveremail@soomeserver");

mail.Subject = "Some Subject";

mail.Body = "see the friendly name in place of email address!";

SmtpClient objSMTP = new SmtpClient("Server IP");

objSMTP.Send(mail);


Lets' see the result.

07 August 2008

Here is a tool to change Visual Studio Theme (Coding Style - Color etc.)



Just select color, click on "Refresh" button to see the effect, and click on "Create" button to download "vssettings" fil.

Open Visual Studio and user "Import Export Setting..." from "Tools" men.

02 August 2008

Before few days a go, It was a requirement to create a menu dynamically and apply link in to it.

Here it is a simple example to create hyperlink to the div tag.



Here in the above image you can see that, there are two menu with div tag, If I'm using HyperLink tag it will just create hyperlink to the text only. But if I want to create HyperLink to the entire block, I will not happens with simple "A" anchor tag.

So here is that trick.




See the above image, there is a style with cursor:pointer; style. It will started to show hyperlink mouse pointer to that image tag.

Now lets add hyper link to the div tag using some javascript.



You can see that using "onClick" event of that div tag have some javascript.

onclick="document.location='./TestPage1.aspx';"

It means when user will click on that div tag it will redirect the page to the "TextPage.aspx"
Visit Leigeber for web development stuff!



This is a blog, you will find so many interesting things with download of the source code. This is very useful for JavaScript developer.

30 July 2008

Get Master Pages tutorials from ASP.Net web site,

There are 10 tutorials what are very useful to learn and also for good pectic for coding. Specifying the Master Page Programmatically and Nested Master are realy useful.

Click Here

There is also available code C# and VB to download.
I was trying to validate FCK Editor, that user must have to enter some value in Editor using RequiredFieldValidator.

But I found that, Required Field Validator will not work with FCK editor directly until you did not change “EnableClientScript” equal to “false".

But CustomValidator will work with FCK editor.

There are two ways to add FCK Editor in ASPX page.

Add Editor using JavaScript




Or Add Editor using FCK Editor Component form Toolbox.



Now Add Custom Validator control to the page.


OK now we have to create a JavaScript function which one help us to check validation.


Done. Run the page and you can see that you must have some value in FCK Editor else it will not post server side event.

22 July 2008

How to Load User Control Dynamically and also access it's property dynamically.

support u have two user control

User Control "a0"


%@ Control Language="C#" AutoEventWireup="true" CodeFile="a0.ascx.cs" Inherits="UserControlTest_a0" %

asp:TextBox ID="TextBox1" runat="server">asp:TextBox>

br /


asp:Button ID="Button1" runat="server" Text="Button" /


And there is a property to something for text value in it's CS file.

public string TextValue
{
get { return TextBox1.Text; }
set { TextBox1.Text = value; }
}


Now User Control "a1"

%@ Control Language="C#" AutoEventWireup="true" CodeFile="a1.ascx.cs" Inherits="UserControlTest_a1" %


%@ Register src="a0.ascx" tagname="ASP" tagprefix="ASP" %


Now in the page load event of this second user control I want to load "a0" user control and also want to set it's "TextValue" property.

protected void Page_Load(object sender, EventArgs e)
{
///Load Control
UserControl ucDynamic = (UserControl)LoadControl("a0.ascx");

///Add User control to the page
this.Controls.Add(ucDynamic);

///Change Property value for newely added user cotrol
///here "UserControlTest" is the name of the folder in my test web site, user have to change it
((UserControlTest_a0)ucDynamic).TextValue = "saAction";
}


It mans there are two user controls "a0" and "a1", Using "UserControl" we can add user control dynamically and to access it's property we have to convert that variable in to our user control.


14 July 2008

08 July 2008

Create Online HTML from

Get all CSS free!!!


Click here

05 July 2008

Don't type too much in aspx page!

just write

asp: Label

and press enter

asp:Label runat=”server” id=”asp_Label2943″ />

Download this add-in from here

Unzip download and copy to :

C:\Documents and Settings\[USER]\Application Data\Microsoft\MSEnvShared\Addins

if you did not found "MSEnvShared" and "Addins" folder then create it manually.