Skip to main content

Posts

Showing posts from September 16, 2012

How to avoid refreshing of page on clicking on BUTTON in jQuery?

Suppose you might have created a button on page.When you click on that button without page refresh some other custom things have to happen. But instead of that, on clicking on the button the page is getting refreshed. How to avoid this?.. Simple, The button click event has default event as refreshing the page. The solution is to "prevent the default event". $("#ButtonID").Click(function(e) {   e.preventDefault(); //Write your custom code here } ); Hope this may help Cheers Pradeepa Achar

How to get the Server's name programmatically and make it as local host url in C#?

It is very simple.You can get the Server name as follows public string serverName = System.Windows.Forms.SystemInformation.ComputerName.ToLower(); Inorder make the serverUrl, you can follow as public string serverUrl = "http://" + System.Windows.Forms.SystemInformation.ComputerName.ToLower(); Hope this will help Cheers Pradeepa Achar