Sunday, July 31, 2011
Saturday, July 30, 2011
Friday, July 29, 2011
Thursday, July 28, 2011
Wednesday, July 27, 2011
How to center a div by jQuery
jQuery.fn.center = function () {
this.css("position","absolute");
this.css("top", (($(window).height() - this.outerHeight()) / 2) + $(window).scrollTop() + "px");
this.css("left", (($(window).width() - this.outerWidth()) / 2) + $(window).scrollLeft() + "px");
return this;
}
$(element).center();
http://stackoverflow.com/questions/210717/using-jquery-to-center-a-div-on-the-screen
Tuesday, July 26, 2011
Monday, July 25, 2011
Sunday, July 24, 2011
Saturday, July 23, 2011
Friday, July 22, 2011
A Forgotten Story - Ajax in ASP.NET using JavaScript
http://blogs.cametoofar.com/post/raw-or-plain-ajax-in-aspnet-using-javascript.aspx
<script type="text/javascript">
function sendViaAjax() {
// Build URL to make Ajax call
var url = "Test.aspx?name=" + document.getElementById("txtName").value;
// Creates an Ajax call object
var xmlHttp; = new XMLHttpRequest();
// Specify URL to connect
xmlHttp.open("GET", url, true);
// Callback function to handle response from Server
xmlHttp.onreadystatechange = function () {
if (xmlHttp.readyState == 4) {
if (xmlHttp.status == 200) {
alert(xmlHttp.responseText);
}
}
};
// Send Ajax request to Server
xmlHttp.send();
}
</script>
protected void Page_Load(object sender, EventArgs e){string ajxValue = "Hello " + Request.QueryString["name"] + " !";Response.Write(ajxValue); // Write the Response
Response.End(); // End Response
}
Thursday, July 21, 2011
Success is a lousy teacher
Success is a lousy teacher.
It seduces smart people into thinking they can't lose.
Bill Gates
It seduces smart people into thinking they can't lose.
Bill Gates
Wednesday, July 20, 2011
SQL Server 2011, "Denali" CTP3 is Here!
http://www.microsoft.com/sqlserver/en/us/future-editions.aspx
We are excited to announce the release of SQL Server Code Name "Denali" Community Technology Preview 3 (CTP3).
We are excited to announce the release of SQL Server Code Name "Denali" Community Technology Preview 3 (CTP3).
Tuesday, July 19, 2011
Monday, July 18, 2011
Worse is Better
http://www.jwz.org/doc/worse-is-better.html
The worse-is-better philosophy is only slightly different:
The worse-is-better philosophy is only slightly different:
- Simplicity-the design must be simple, both in implementation and interface. It is more important for the implementation to be simple than the interface. Simplicity is the most important consideration in a design.
- Correctness-the design must be correct in all observable aspects. It is slightly better to be simple than correct.
- Consistency-the design must not be overly inconsistent. Consistency can be sacrificed for simplicity in some cases, but it is better to drop those parts of the design that deal with less common circumstances than to introduce either implementational complexity or inconsistency.
- Completeness-the design must cover as many important situations as is practical. All reasonably expected cases should be covered. Completeness can be sacrificed in favor of any other quality. In fact, completeness must sacrificed whenever implementation simplicity is jeopardized. Consistency can be sacrificed to achieve completeness if simplicity is retained; especially worthless is consistency of interface.
Sunday, July 17, 2011
Saturday, July 16, 2011
Friday, July 15, 2011
Thursday, July 14, 2011
Wednesday, July 13, 2011
Tuesday, July 12, 2011
Monday, July 11, 2011
How to solve web service not working in AutoCompleteExtender?
Make sure added [System.Web.Script.Services.ScriptService] into class level of web service
using System;
using System.Collections.Specialized;
using System.Web.Services;
namespace testauto
{
[WebService(Namespace = "http://tempuri.org/")]
[WebServiceBinding(ConformsTo = WsiProfiles.BasicProfile1_1)]
[System.ComponentModel.ToolboxItem(false)]
[System.Web.Script.Services.ScriptService]
public class test : System.Web.Services.WebService
{
[System.Web.Services.WebMethod]
[System.Web.Script.Services.ScriptMethod]
public string[]
GetCompletionList(string prefixText, int count)
{
StringCollection names = new
StringCollection();
names.Add("a");
names.Add("ab");
names.Add("abc");
names.Add("b");
names.Add("bb");
String[] namesarray = new
String[names.Count];
names.CopyTo(namesarray, 0);
return namesarray;
}
}
}
<asp:TextBox ID="TextBox1"
runat="server"></asp:TextBox>
<asp:AutoCompleteExtender
ID="TextBox1_AutoCompleteExtender"
runat="server"
TargetControlID="TextBox1"
ServiceMethod="GetCompletionList"
ServicePath="~/test.asmx"
MinimumPrefixLength="2"
CompletionInterval="1000"
EnableCaching="true"
CompletionSetCount="20">
</asp:AutoCompleteExtender>
Sunday, July 10, 2011
Saturday, July 9, 2011
Friday, July 8, 2011
How to show busy cursor while loading a page in ASP.NET?
Put loading
information into one div, and main contain to another div. Then use jQuery
ready function to show main content and hide busy cursor
$(document).ready(function () {
$('#loadinginfo').hide();
$('#mainContain').show();
});
How to centralize content in div by CSS?
<div
style="width: 50%; margin: 0
auto;">Hello</div>
OR
<div style="text-align: center">
<div style="width: 50%; margin: 0 auto; text-align: left">Hello</div>
</div>
<div style="width: 50%; margin: 0 auto; text-align: left">Hello</div>
</div>
Subscribe to:
Posts (Atom)