02 November 2009

 

Visual Basic Power Packs 3.0 have very cool same as we web application, named DataRepeater.

lets do some cool stuff with DataRepeater control.

  • Add Data source.
  • Add Combobox in datarepeater control
  • Hide show controls runtime in datarepeater control

 

DataRepeater

See the above image, We have a button, a DataRepeater control and in data  repeater control we have a textbox, a combo box and a label which will hide and show runtime by selecting value of combobox.

So lets start, how to do this.

 

Create a class to save data, I am not using any DataTable for this example.

public class data1 : List<data1>
    {
        private string mName;
        private string mDdlValue;

        public data1()
        {
        }

       public string Name
        {
            get { return mName; }
            set { mName = value; }
        }

        public string DdlValue
        {
            get { return mDdlValue; }
            set { mDdlValue = value; }
        }
    }
}

In above code we have two property “Name” and “DdlValue” and it is inherited with “List” to bind data.

Now lets bind that controls with data1 class

I will use Form_Load  event to do this.

/// <summary>
/// data1 variable declaration in Form Class
/// </summary>
private data1 objData = new data1();

 

private void Form1_Load(object sender, EventArgs e)
{
    ///Bind Textbox with Name property
    tbName.DataBindings.Add(new System.Windows.Forms.Binding("Text", objData, "Name"));

    ///Bind Combo box with DdlValue property
    comboBox1.DataBindings.Add(new System.Windows.Forms.Binding("Text", objData, "DdlValue"));
}

 

And databind “objData” to DataRepeater1 control, I will use button click event to do this.

private void button2_Click(object sender, EventArgs e)
{
    objData.Add(new data1());
    dataRepeater1.DataSource = null;
    dataRepeater1.DataSource = objData;
}

 

Ok to now when  you will click on button2, it will add new item in “objData” and then, bind it to dataRepeater1 control.

But still we have to add item in combobox, So we need to use “ItemCloned” event to do this.

private void dataRepeater1_ItemCloned(object sender, Microsoft.VisualBasic.PowerPacks.DataRepeaterItemEventArgs e)
{
    ComboBox c1 = (ComboBox)e.DataRepeaterItem.Controls.Find("comboBox1", true)[0];

    c1.Items.Add("sa1");
    c1.Items.Add("sa2");
    c1.Items.Add("sa3");
    c1.Items.Add("sa4");
    c1.Items.Add("sa5");
}

you can see that now there are 5 item in combo box.

and finally let hide and show a label control dynamically, Here in example the logic is, when use select “sa2” from combo box it will show the label else it will be hide.

We have to use DrowItem event to do this.

private void dataRepeater1_DrawItem(object sender, DataRepeaterItemEventArgs e)
{
    if (objData[e.DataRepeaterItem.ItemIndex].DdlValue == "sa2")
    {
        ((Label)e.DataRepeaterItem.Controls.Find("label2", true)[0]).Text = "this is second option";
    }
    else
    {
        ((Label)e.DataRepeaterItem.Controls.Find("label2", true)[0]).Visible = false;
    }
}

So this is good to run our program, but one more thing, If you want to hide show label directly when use change value from dropdown list, you have to add SelectedIndexChanged to combobox1.

private void comboBox1_SelectedIndexChanged(object sender, EventArgs e)
{
    ComboBox cbo = ((ComboBox)(sender));

    DataRepeaterItem prnt = (DataRepeaterItem)(cbo.Parent);

    Label objLavel = ((Label)(prnt.Controls.Find("Label2", true)[0]));
    if (cbo.SelectedIndex == -1)
    {
        return;
    }
    if (cbo.Text == "sa2")
    {
        objLavel.Visible = true;
        objLavel.Text = cbo.Text;
    }
    else
    {
        objLavel.Visible = false;
    }
}

So just press F5 to run this program.

So this is a very simple example to work with dataRepeater control, you can utilize your requirement in it and have some cool looking information in your window application!

23 September 2009

Google map allows us to create radius in its map, user will drag and drop that radius in different location and he will able to show only those pointers which are search result in his selected criteria.
Visit this example : http://maps.forum.nu/gm_sensitive circle2.html to create radius in Google map.
Google saAction
Now we can get new updated radius value from JavaScript function.
We have to pass that amount to SQL Server stored procedure Below is that sql :

    CREATE PROCEDURE uspAddress_GetByRadius
        @Latitude        decimal(10,8)
        ,@Longitude        decimal(10,8)   
        ,@Radius        decimal(5,3)
    AS
    BEGIN

        DECLARE @R decimal(18,10)
        SET @R = PI()/180

        SELECT
              ACOS((SIN(@Latitude*@R)* SIN(Latitude*@R)) + (COS(@Latitude*@R)* COS(Latitude*@R) * COS(Longitude*@R - @Longitude*@R))) * 6378.137 AS Distance
              ,A.*
        FROM
              (SELECT
                     CONVERT(decimal(10,8), SUBSTRING(LMapCoordonates, 0, CHARINDEX(',',LMapCoordonates))) as Latitude
                    ,CONVERT(decimal(10,8), SUBSTRING(LMapCoordonates, CHARINDEX(',',LMapCoordonates) + 1, 100)) as Longitude
                    ,tblAddress.*
              FROM tblAddress) AS A
        WHERE      
            ACOS((SIN(@Latitude*@R)* SIN(Latitude*@R)) + (COS(@Latitude*@R)* COS(Latitude*@R) * COS(Longitude*@R - @Longitude*@R))) * 6378.137 <= @Radius
    END

We will apply Google map’s new Latitude and Longitude value and radius area to the sql server’s stored procedure and it will return only those records which are satisfy that criteria.

18 September 2009

PicJoke is online photo editor tool, which allows to embed funny frame to our uploaded image.

There are so many frame Effects.

Have some quick fun.

31 August 2009

Download jQuery 1.3 Cheat Sheet from http://oscarotero.com/jquery/

jQuery

it is also link to its example.

28 August 2009

I few months a go have posted about some WYSIWYG editor, I have come to know that there is one more tool next generation solution of FCK Editor.

Almost all developers knows about FCK Editor, Now there is a new version, CK Editor.

ckEditor

There is all features of FCK editor and dozens of new functionality. CK Editor is faster is fast to load and fast to use.Its current version is 3.0

See demo here.

24 August 2009

I have seen many times that Thickbox normal works with <a href=””></a> syntax,

Ex :

Inner Page Content Syntex :

<a href="#TB_inline?height=200&width=200&inlineId=hiddenModalContentID&modal=true"
class="thickbox">Click here to show hidden modal content.</a>

IFrame Syntex :


<a href="testPage.aspx?keepThis=false&TB_iframe=true&height=200&width=200"
title="saActionPage" class="thickbox">Click here</a>  

But what happen when you need to open ThickBox by click event? Here is its solution.


You can to use same syntax of HREF  with “tb_show” function.


Ex :


<script language="javascript" type="text/javascript">

    function showTB()  {

       var newURL = "#TB_inline?height=200&width=300&inlineId=hiddenModalContentID";

        tb_show("ThickBox Title Here", newURL);

    }

</script>


It means you can also open thick box by any other event also.

18 August 2009

Last Month I posted that How to export to excel from web page with data formatting.

But when you are trying to export entire grid specially with Boolean datatype column,

 

               string attachment = "attachment; filename=Registration.xls";
               Response.ClearContent();
               Response.AddHeader("content-disposition", attachment);
               Response.Charset = "";
               //set the Response mime type for excel
               Response.ContentType = "application/vnd.ms-excel";
               //create a string writer
               System.IO.StringWriter stringWrite = new System.IO.StringWriter();
               //create an htmltextwriter which uses the stringwriter
               System.Web.UI.HtmlTextWriter htmlWrite = new System.Web.UI.HtmlTextWriter(stringWrite);
               //instantiate a datagrid
               GridView dg = new GridView();
               dg.RowDataBound += new GridViewRowEventHandler(GridView1_RowDataBound);
               //set the datagrid datasource to the dataset passed in
               dg.DataSource = dt;
               //bind the datagrid
               dg.DataBind();
               //dg.Columns[1].ItemStyle.
               //tell the datagrid to render itself to our htmltextwriter
               dg.RenderControl(htmlWrite);
               //all that's left is to output the html
               Response.Write(stringWrite.ToString());
               Response.End();

 

its result:

export check box

You can see that checkbox is there, But this is not user friendly. because in excel operator are not familiar with check box in excel data.

It means there should be 1/0  or True/False in place of checkbox. lets see.

Add RowDataBound event to the grid…

 

               GridView dg = new GridView();
               dg.RowDataBound += new GridViewRowEventHandler(GridView1_RowDataBound);

 

Now create an event…

protected void GridView1_RowDataBound(object sender, GridViewRowEventArgs e)
{
    if (e.Row.RowType == DataControlRowType.DataRow)
    {
        CheckBox chk = (CheckBox)e.Row.Cells[1].Controls[0];
        chk.Visible = false;
        if (chk.Checked)
        {
            e.Row.Cells[1].Text = "1";
        }
        else
        {
            e.Row.Cells[1].Text = "0";
        }

    }
}

You can see that now checkbox is invisible and we are writing 1 or 0 in the same cell, Cells[1] is static value for second column.

and now see the result…

export 01

You can see that value is now changed in to 1 inplace of checkbox.

We can change any kind of data by using RowDataBound event.

30 July 2009

Normally we have to pass Latitude and Longitude to get location, but Using Google API “geocoder.getLatLng()” we can get location by passing address. thanks to one of my friend Dhiren Javia to find this solution for me.

saAction Location

 

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xmlns:v="urn:schemas-microsoft-com:vml">
<head>
    <meta http-equiv="content-type" content="text/html; charset=UTF-8" />
    <title>Google Maps API Example: Simple Geocoding</title>

    <script src="http://maps.google.com/maps?file=api&v=2.x&key=ABQIAAAAzr2EBOXUKnm_jVnk0OJI7xSosDVG8KKPE1-m51RBrvYughuyMxQ-i1QfUnH94QxWIa6N4U6MouMmBA" type="text/javascript"></script>

    <script type="text/javascript">

        var map = null;
        var geocoder = null;

        function initialize() {
            if (GBrowserIsCompatible()) {
                map = new GMap2(document.getElementById("map_canvas"));
                map.setCenter(new GLatLng(22.18, 70.56), 4);
                geocoder = new GClientGeocoder();
            }
        }

        function showAddress(address) {
            if (geocoder) {
                geocoder.getLatLng(
                address,
                function(point) {
                    if (!point) {
                        alert("Location not found : " + address);
                    } else {
                        map.setCenter(point, 13);
                        var marker = new GMarker(point);
                        map.addOverlay(marker);
                        marker.openInfoWindowHtml(address);
                    }
                }
                );
            }
        }

        showAddress(this.address.value);
    </script>

</head>
<body onload="initialize();" onunload="GUnload()">
    <form action="#" onsubmit="showAddress(this.address.value); return false">
    <p>
        <input type="text" size="60" name="address" value="Rajkot" />
        <input type="submit" value="Go!" />
    </p>
    <div id="map_canvas" style="width: 500px; height: 300px">
    </div>
    </form>
</body>
</html>

27 July 2009

Apply image reflection effect using jQuery visit here

saaction image refelction

Reflection.js for jQuery is very cool plug-in to apply reflection in image dynamically without uploading two images. It is also allows you to add instantaneous reflection effects to your images in modern browsers, in less than 2 KB.

It will create a “Canvas” tag programmatically to show reflection and working will almost all browsers. See demo here.

22 July 2009

This is very good idea to compresses CSS file before uploading it on web server, It compress the file size and improve performance of web site. But some time we need to edit the same compresses file it is very big headache, There is a small online tool to compress and decompress CSS.

Visit here

saAction csCSSc  Client-side CSS Compressor & Decompressor

10 July 2009

Microsoft have launch new search web site, Bing.com, When we open this web site, there will be a cool background every day.

bing

Find all archives of those cool background from here.

If you don’t want to load that image use this URL one time http://www.bing.com/?rb=0. Here rb=0 means No Background Image, and type rb=1 to load it.

09 July 2009

Let create cool JavaScript thumbnail zoom effect.

The concept is that there will be thumbnail on page user can see it and original image will be hidden at the same time and when user rollover on that thumbnail hidden main image will smoothly resize on the same place.


<script src="thumbscreen.js" type="text/javascript"></script>

<
div>

<
img src="saAction Real.jpg" alt="saAction" id="screen1"
onmouseout
="reducethumb(1); return false;" style="position: absolute;
display: none;"
width="240" border="0" height="269">

<
img src="saAction Thumb.jpg" alt="saAction" id="thumb1"
onmouseover
="expandthumb(1, 500, 300);">

</
div>


Settings :

Thumbnail Image
  • id must be "thimbN", N means number example : thumb1, thumb2 etc.
  • add "onmouseover" event and cell "expandthumb" function
  • "expandthumb" have three arguments (thumbnail ID last number, main image width, main image height)
Mani Image
  • id must be "screenN", N means number example : screen1, screen2 etc.
  • Style="display:none;"
  • add "onmouseout" event and cell "reducethumb" function
  • "reducethumb" function take one argument (main image ID last number)

thats all when you will mouse over on thumbnail it will show main mage on same plase with smooth scrool effect.

Isn't it cool download demo.

08 July 2009

I have faced this problem many times posting an article on blog spot. I was not able to provide good HTML, C# or any other code with color formatting, The problem is at the HTML code was rendering as HTML and breaking the post content, It is not able to get different between our articles code and its own code.

So tried to find its solution over the net, and get many good result.

1) SimpleCode

This very simple code online tool to converter HTML in compress mode. simple and quick, Enter HTML markup, click on “Process” button and get encoded markup, you will also see preview at the buttom of the page



2) C# Code Format

This is very cool tool, It provides us to seelct language like C#, VB.Net, HTML, T-SQL and MSH. This is also option to add live number in code.

Just click on “Format My Code” button and you will get encoded HTML code with preview. See the result example below:

this is cool result, we can aslo change code style as we want, and its give CSS, it is good to apply CSS in <header> tag and the reason is that we don’t have to apply CSS file in each post.


3) CopySourceAsHtml

CSAH is one kind of add-in for Microsoft Visual Studio only It is able to work with Visual Studio 2003, 2005 and 2008.

After installing this add-in there will be a new menu in “Edit”, named “Copy as HTML…”. When you click on it will show a dialogbox for settings.


There is a one cool feature for Line Number, we enter starting line number, It is user fult when we are giving information in detailed description. Syntax highlighting, CSAH uses Visual Studio's syntax highlighting and font and color settings automatically. If Visual Studio can highlight it, CSAH can copy it, and your source should look the same in your browser as it does in your editor.


4) Encode / Decode HTML Entities

Here we have good feature that we can aslo decode give HTML.

But there is not any advance fuatures as line number or color formating.


5) BlogJet

If you want POST in your blog by any desktop application that can add post directly in your blog, BlogJet is a good software. It is a popular Windows blog client for your WordPress, TypePad, Blogger, Drupal, etc. blogs. Get convenience and speed of a native application, and the ability to write posts offline.


We can also save post in our cumputer by “bjd” file format, This application will automatically decode HTML content.




So, here are many featurs abailabel to post HTML, C#, VB.Net.


Go ahad and start posting with user friendly look.

07 July 2009

Microsoft .Net Framework 3.5 provides Chart Control for Windows and Web applications.

let learn quick start about Chart control with Asp.net web site.

You have to download MSChart for Microsoft .NET Framework 3.5, It will install new assemblies that contain the ASP.NET and Windows Forms Chart Controls.

After its installation you have to add that control in Visual Studio's ToolBox, it will not comes automatically.

there are two ways to do it, Download Microsoft Chart Controls Add-on for Microsoft Visual Studio 2008. It is provide Visual Studio toolbox integration and IntelliSense for the Asp.NET and Windows Forms Chart controls and will start to show in toolbox, else use second way just drag and drop it's DLL file or chose item from toolbox from "[SystemDrive]\Program Files\Microsoft Chart Controls\Assemblies" all chart control's dll files are here,

Use "System.Web.DataVisualization.dll" for Web applications and "System.Windows.Forms.DataVisualization.dll" for Windows Form application

Now we are ready to use Microsoft Chart Control.

Now create a new web page and drag and drop chart control on page.


See the chart control's HTML:



Now you can bind directly form database but here lets create a class for with to fields Name and Salary.



So we have two fields here Name and Salary, lets enter some records in page load event.


Three records are entered. Now lets bind chart control.


"Series" property is use to create X and Y axis data.


  1. protected void Page_Load(object sender, EventArgs e)
  2. {
    1. dataChart d1 = new dataChart();

    2. d1.Add(new dataChart("Samir", 20));
    3. d1.Add(new dataChart("Vijay", 30));
    4. d1.Add(new dataChart("Ram", 15));

    5. Chart1.DataSource = d1;
    6. Chart1.Series["Series1"].XValueMember = "name";
    7. Chart1.Series["Series1"].YValueMembers = "Salary";
    8. Chart1.DataBind();
  3. }


lets see the result :


This is column chart as default chart type, now lets change ChartType="Pie" and see the results:



There are many chart types are available and we can also create 3d chart. you can also save chart result as image using "SaveImage()" method. and also many other features. You can also bind with database using DataTable and also can write down static columns (Series) using HTML.

This is very useful control whenever we required to create chart.

Happy codding.

06 July 2009

Many mobile user uses Flash animated wallpaper or screen sever, and they really like some kind of motion on mobile phone screen. And if you know flash and want to create some existing job with it. This quick tutorial will be help full to you.

lets create flash file which can run in your mobile?

This is very easy, lets create a flash file to apply it as wallpaper or screen sever.

I am using Flash cs2 to create this application.

Open Flash and select "Flash File (Mobile)" option.


You will get new dialog box for mobile application.



Select appropriate mobile phone device as per your requirement, I have Nokia 6300 and there for I am select using Flash Lite 2.0 16 240 X 320 from Device Set list.

click on "Create" button after selection, you will get blank flash with mobile screen layout.

Now put some images and text etc as you want:
and also create two text box to show bettye level and signal.



Chagnge those two textboxes property as dynamic and server variable.


Textbox 1 : variable name "nBattery"
Textbox 2 : variable name "nSignal"


Now create two frame, this is because frame will play it self and every time we can get new amount for battery and signal :


Now add below action script
Add this script in first frame.


Here it is that code.

  • fscommand2("FullScreen", 1);
  • nBattery = "Battery: " add fscommand2("GetBatteryLevel") add "%";
  • nSignal = "Signal: " add fscommand2("GetSignalLevel") add "%";


that's all.
see the preview in emulator by pressing "Ctrl + Enter"


it will compile the code and will create a SWF file.

Now transfer that "swf" file in your mobile phone. and you can user it as wallpaper or screen sever.

Remember that your mobile phone need Flash support.

Create your own name's wallpaper, screen sever and apply it in mobile phone, and send to your friends.

have some fun.

05 July 2009

Have some fun, Whether you wear Specs or not, Its Mandatory U Complete each Test in 4-5 Seconds,

This is a simple neurological test.
Sit comfortably and be calm !


1- Find the C below. Do not use any cursor help.

OOOOOOOOOOOOOOOOOOO
OOOOOOOOOOOOOOOO OOOOOOOOOOOOOOOO

OOOOOOOOOOOOOOOOOOO
OOOOOOOOOOOOOOOO OOOOOOOOOOOOOOOO

OOOOOOOOOOOOOOOOOOO
OOOOOOOOOOOOOOOO OOOOOOOOOOOOOOOO

OOOOOOOOOOOOOOOOOOO
OOOOOOOOOOOOOOOO OOOOOOOOOOOOOOOO

OOOOOOOOOOOOOOOOOOO
OOOOOOOOOOOOOOOO OOOOOOOOOOOOOOOO

OOOOOOOOOOOOOOOOOOO
OOOOOOOOOOOOOOOO OOOOOOOOOOOOOOOO

OOOOOOOOOOOOOOOOOOO
OOOOOOOOOOOOOOOO COOOOOOOOOOOOOOO

OOOOOOOOOOOOOOOOOOO
OOOOOOOOOOOOOOOO OOOOOOOOOOOOOOOO

OOOOOOOOOOOOOOOOOOO
OOOOOOOOOOOOOOOO OOOOOOOOOOOOOOOO

OOOOOOOOOOOOOOOOOOO
OOOOOOOOOOOOOOOO OOOOOOOOOOOOOOOO

OOOOOOOOOOOOOOOOOOO
OOOOOOOOOOOOOOOO OOOOOOOOOOOOOOOO





2- If you already found the C, now find the 6 below.

9999999999999999999 9999999999999999
9999999999999999 9999999999999

9999999999999999999 9999999999999999
9999999999999999 9999999999999

9999999999999999999 9999999999999999
9999999999999999 9999999999999

9999699999999999999 9999999999999999
9999999999999999 9999999999999

9999999999999999999 9999999999999999
9999999999999999 9999999999999

9999999999999999999 9999999999999999
9999999999999999 9999999999999






3- Now find the N below. It's a little more difficult..

MMMMMMMMMMMMMMMMMMM
MMMMMMMMMMMMMMMM MNMMMM
MMMMMMMMMMMMMMMMMMM
MMMMMMMMMMMMMMMM MMMMMM
MMMMMMMMMMMMMMMMMMM
MMMMMMMMMMMMMMMM MMMMMM
MMMMMMMMMMMMMMMMMMM
MMMMMMMMMMMMMMMM MMMMMM
MMMMMMMMMMMMMMMMMMM



This is NOT a joke. If you were able to pass these 3 tests, you can cancel
your annual visit to your neurologist.
Your brain is great and you're far from having Alzheimer Disease.

Congratulations!

03 July 2009

Many time in commercial web sites client want to export data as excel sheet result correct with date time formatting and number decimal point formatting.

here is that kind of example.

string styles = "style> .amount { mso-number-format:0.00; } .exDate { mso-number-format: dd\\/mmm\\/yyyy; } /style> ";
//please write lessthan sign before "style" word


Table xl = new Table();
xl.BorderWidth = 1;
System.Web.UI.HtmlControls.HtmlForm form = new System.Web.UI.HtmlControls.HtmlForm();

string attachment = "attachment; filename=saActionTest.xls";

Response.ClearContent();
Response.AddHeader("content-disposition", attachment);
Response.ContentType = "application/ms-excel";

System.IO.StringWriter stw = new System.IO.StringWriter();
System.Web.UI.HtmlTextWriter htextw = new System.Web.UI.HtmlTextWriter(stw);

TableRow trTitle = new TableRow();
TableCell tcTitle = new TableCell();
tcTitle.Text = "saAction Test";
trTitle.Cells.Add(tcTitle);

TableCell tcDate = new TableCell();
tcDate.CssClass = "exDate";
tcDate.Text = DateTime.Now.ToShortDateString();
trTitle.Cells.Add(tcDate);

double m1 = 150.50;
TableRow trTitle2 = new TableRow();
TableCell tcTitle2 = new TableCell();
tcTitle2.CssClass = "amount";
tcTitle2.Text = m1.ToString();
trTitle2.Cells.Add(tcTitle2);

xl.Rows.Add(trTitle);

xl.RenderControl(htextw);
xl.Dispose();

Response.Write(stw.ToString());
Response.End();


And the excel sheet result is :



You can see that there is also date, Now Some time many developer faces date problem MM/dd/yyy or dd/MM/yyyy etc. it depends on system's setting as default though you want to add your own date format you have to apply style "mso-number-format" in your code.

There are many other style you can apply to get correct date and number decimal points amount.

mso-number-format:"0" No Decimals
mso-number-format:"0\.00" 2 Decimals
mso-number-format:"mm\/dd\/yy" Date format
mso-number-format:"m\/d\/yy\ h\:mm\ AM\/PM" D -T AMPM
mso-number-format:"Short Date" 03/07/2009
mso-number-format:"Medium Date" 05-jan-2008
mso-number-format:"Short Time" 8:67
mso-number-format:"Medium Time" 8:67 am
mso-number-format:"Long Time" 8:67:25:00
mso-number-format:"Percent" Percent - two decimals
mso-number-format:"0\.E+00" Scientific Notation
mso-number-format:"\@" Text
mso-number-format:"\#\ ???\/???" Fractions - up to 3 digits (312/943)
mso-number-format:"\0022£\0022\#\,\#\#0\.00" £12.76
mso-number-format:"\#\,\#\#0\.00_ \;\[Red\]\-\#\,\#\#0\.00\ " 2 decimals, negative numbers in red and signed
(1.86 -1.66)
mso-number-format:"\\#\\,\\#\\#0\\.00_\\)\\;\\[Black\\]\\\\(\\#\\,\\#\\#0\\.00\\\\)" Accounting Format –5,(5)

30 June 2009

Web designers have limitation to use font in web site, because fonts are comes form user computer not from web site.

But Adobe Flash have a feature to embed font in flash animation.

sIFR is meant to replace short passages of plain browser text with text rendered in your typeface of choice, regardless of whether or not your users have that font installed on their systems. It accomplishes this by using a combination of javascript,

Read more about sIFR.

See the example.

26 June 2009

Which java script framework you are using? If you are confuse that which framework use in web development jQuery or MootTools; I suggest you to go through this article.

This web site have very useful information about jQuery and MootTools.

Visit http://jqueryvsmootools.com/

Well I like jQuery. ;)
It is very good to compress javascript before you upload it before live site.

here it is a online tool to Compress and obfuscate Javascript code online completely free using this compressor.

Just enter your code and click on "Compress".


make it easy!

25 June 2009

Add cool flash based gadgets in you block.


See here, click any where in flash area fish will come here to eat that food!




Visit http://abowman.com/google-modules/ too see more gadgets.

19 June 2009

Writing inline documentation is very useful but many developers are excusing that its is taking to much time to write down comments, Friends here is a tool for you which will write XML documentation in your C# or VB.net code vary quickly.

This tool is works with Visual Studio 2005, 2008.

GhostDoc is a free Visual Studio extension that automatically generates XML documentation comments.

Its allows us to add quick documentation for :
  • Methods
  • Properties with its data type
  • Parameters Name
  • Variable Name
See the below example :


Just right click on clock on the name of the function, where will be a menu with "Document this".
Click on it and it will write word quickly documentation for you.

See here the result:



So GhostDoc is very useful tool,

happy codding.

17 June 2009

I you are working on live site and you need to make some modifications on live server, during this modification you want to show a user friendly message that "Site is under maintenance" or "Site is under construction." or something like that, without affecting any page or database.

You just need to make a simple HTML page with "app_offline.htm" name and upload it on root directory of the web site. once user try to open this site, IIS will open this page in place of "default.aspx".

and you can write down, user friendly message on this page. after completing your task just delete this file or rename it. and site will start work as it is.


16 June 2009

WMD is a simple, lightweight HTML editor for blog comments, forum posts, and basic content management. You can add WMD to any textarea with one line of code. Add live preview with one line more.

See Demo here.

If any user don't want any advance functionality and just want to provide lightweight HTML editor, WMD is a very useful tool.

Some other popular editor are :

15 June 2009

When user click on "Send", "Submit", "Save" or "OK" button, page starts process for postback and user did net get idea whats going on,

Some time when there is lots of data are transferring; we need to create user friendly web application to get idea to user that still its working please wait for some time.

Using only javascript to so process or fire some function when user click on submit button, after check validations or before checking validation.

A button on page:
asp:button runat="server" id="btnSave" onclick="btnSave_Click">


One hidden div tag with processing image:

div id="divProcess" class="goProcess">
img src="http://www.blogger.com/images/bigrotation2.gif" alt="Image" />
/div>


Now one javascript function:

script language="javascript" type="text/javascript">
function WebForm_OnSubmit() {
if (typeof (ValidatorOnSubmit) == "function" && ValidatorOnSubmit() == false) {
return false;
}
else {
document.getElementById("divProcess").style.display = "block";
return true;
}
}
/script>


that all; now when user click on submit button; it will check validations first; else it will show that image;

the javascript function name is "WebForm_OnSubmit" which fires every time when user clicks on Submit button.

14 April 2009

CSS Z-Index is not working in IE7 Visit here to get you answer.

Z-Index and position tag have are

10 March 2009

# Local variable

Mein pal do pal ka shayar hoon,
pal do pal meri kahani hai
pal do pal meri hasti hai..

# Global variable

Main har ik pal ka shayar hoon
har ik pal meri kahani hai
har ik pal meri hasti hai

# Null pointers

Mera jeevan kora kagaz
kora hi reh gaya..

# Dangling pointers

Maut bhi aati nahi
jaan bhi jati nahin.

# Goto

Ajeeb dastan hai yeh
Kahan shuru kahan khatam
Ye manzilen hain kaun si
Na woh samajh sake na hum

# Two Recursive functions calling each other

Mujhe kuchh kehna hein
mujhe bhi kuchh kehna hein
Pehle tum, pehle tum.

# The debugger

Jab koi baat bigad jaye
Jab koi mushkil pad jaye
Tum dena saath mera hamnawaz.

# From VC++ to VB

Yeh haseen vaadiyan
Yeh khula asmaan
Aa gaye hum kahan.

# Untrackable bug

Aye ajnabi, tu bhi kabhi, awaaz de kahin se.

# Unexpected bug (esp during presentation to client)

Ye kya hua, Kaise hua, Kab hua, Kyon hua

27 February 2009

System.Web.Mail is a web site to get very useful information, There is also faq to send to send email different kind of email.

26 February 2009

You can apply date format in RegularExpressionValidator

suppose I have a textbox to apply date time by "dd/MM/yyyy" format.

I can use flowing ValidationExpression:

<asp:RegularExpressionValidator
ID="RegularExpressionValidator2"
runat="server"
ValidationExpression="(0[1-9]|[12][0-9]|3[01])[- /.](0[1-9]|1[012])[- /.](19|20)\d\d"
ControlToValidate="myTextBox"
ErrorMessage="Enter date in dd/mm/yyyy format">