Monday, April 19, 2010

call javascript function every time when the page load

//call javascript function every time when the page load
//include the partial page post back

ScriptManager sm = ScriptManager.GetCurrent(Page);
if (sm.IsInAsyncPostBack)
{
Page.ClientScript.RegisterStartupScript(this.GetType(), "anotherKey", "CheckingCostDiv();", true);
}
else
{
Page.ClientScript.RegisterStartupScript(this.GetType(), "anotherKey", "Sys.Application.add_load(CheckingCostDiv);", true);
}

Wednesday, April 14, 2010

Comparison of wireless data standards






































































Comparison of Mobile Internet Access methods
StandardFamilyPrimary UseRadio TechDownlink (Mbit/s)Uplink (Mbit/s)Notes
LTEUMTS/4GSMGeneral 4GOFDMA/MIMO/SC-FDMA36080LTE-Advanced update expected to offer peak rates of at least 1 Gbit/s fixed speeds and 100 Mbit/s to mobile users.
WiMAX802.16eMobile InternetMIMO-SOFDMA14435WiMAX update IEEE 802.16m expected offer up to 1 Gbit/s fixed speeds.
Wi-Fi802.11

(11n)
Mobile InternetOFDM/MIMO288.9

(Supports 600Mbps @ 40MHz channel width)

Antenna, RF front end enhancements and minor protocol timer tweaks have helped deploy long range P2P networks compromising on radial coverage, throughput and/or spectra efficiency (310km & 382km).


EDGE EvolutionGSMMobile InternetTDMA/FDD1.90.93GPP Release 7
UMTS W-CDMA

HSDPA+HSUPA

HSPA+
UMTS/3GSMGeneral 3GCDMA/FDD



CDMA/FDD/MIMO
0.384

14.4

56
0.384

5.76

22
HSDPA widely deployed. Typical downlink rates today 2 Mbit/s, ~200 kbit/s uplink; HSPA+ downlink up to 56 Mbit/s.
EV-DO 1x Rev. 0

EV-DO 1x Rev.A

EV-DO Rev.B
CDMA2000Mobile InternetCDMA/FDD2.45

3.1

4.9xN
0.15

1.8

1.8xN
Rev B note: N is the number of 1.25 MHz chunks of spectrum used. Not yet deployed.

http://en.wikipedia.org/wiki/Comparison_of_wireless_data_standards

Tuesday, April 13, 2010

Get URL parameters & values with jQuery

http://jquery-howto.blogspot.com/2009/09/get-url-parameters-values-with-jquery.html

// Read a page's GET URL variables and return them as an associative array.
function getUrlVars()
{
var vars = [], hash;
var hashes = window.location.href.slice(window.location.href.indexOf('?') + 1).split('&');
for(var i = 0; i < hashes.length; i++)
{
hash = hashes[i].split('=');
vars.push(hash[0]);
vars[hash[0]] = hash[1];
}
return vars;
}

http://www.example.com/?me=myValue&name2=SomeOtherValue

var second = getUrlVars()["name2"];

$.extend({
getUrlVars: function(){
var vars = [], hash;
var hashes = window.location.href.slice(window.location.href.indexOf('?') + 1).split('&');
for(var i = 0; i < hashes.length; i++)
{
hash = hashes[i].split('=');
vars.push(hash[0]);
vars[hash[0]] = hash[1];
}
return vars;
},
getUrlVar: function(name){
return $.getUrlVars()[name];
}
});

// Get object of URL parameters
var allVars = $.getUrlVars();

// Getting URL var by its nam
var byName = $.getUrlVar('name');

Wednesday, April 7, 2010

ASP.NET AJAX UpdatePanels post less data by JSON

http://encosia.com/2007/07/11/why-aspnet-ajax-updatepanels-are-dangerous/

OLD style:
<asp:ScriptManager ID="ScriptManager1" runat="server" />

<asp:UpdatePanel runat="server" ID="up1">
<ContentTemplate>
<asp:Label runat="server" ID="Label1" Text="Update Me!" /><br />
<asp:Button runat="server" ID="Button1"
Text="Postback Update" OnClick="Button1_Click" />
ContentTemplate>
asp:UpdatePanel>

protected void Button1_Click(object sender, EventArgs e)

{
Label1.Text = DateTime.Now.ToLongDateString();
}

NEW style:
<asp:ScriptManager ID="ScriptManager1" runat="server"

EnablePageMethods="true" />
<script language="javascript">
function UpdateTime() {
PageMethods.GetCurrentDate(OnSucceeded, OnFailed);
}

function OnSucceeded(result, userContext, methodName) {
$get('Label1').innerHTML = result;
}

function OnFailed(error, userContext, methodName) {
$get('Label1').innerHTML = "An error occured.";
}
script>
<asp:Label runat="server" ID="Label1" Text="Update Me!" /><br />
<input type="button" id="Button2" value="Web Method Update"
onclick="UpdateTime();" />

[WebMethod]

public static string GetCurrentDate()
{
return DateTime.Now.ToLongDateString();
}

Saturday, April 3, 2010

List of countries by GDP (PPP) per capita - International Monetary Fund (2009)

Do you think your country is rich? have a look this:

Rank Country Intl. $
1 Qatar 87,717
5 Singapore 49,433
6 United States 46,443
7 Hong Kong 42,574
12 Canada 38,290
14 Australia 37,302
20 United Kingdom 35,165
22 Germany 34,219
23 France 33,744
24 Japan 32,817
27 Republic of China (Taiwan) 29,829
29 Italy 29,290
32 Korea, South 27,791
34 New Zealand 26,625
51 Russia 15,039
— World[5] 10,348
79 Saint Vincent and the Grenadines 10,198
80 South Africa 9,961
97 China, People's Republic of 6,546
128 India 2,932

Ref:http://en.wikipedia.org/wiki/List_of_countries_by_GDP_%28PPP%29