Posts

Proxy settings in android phone

Hi all, here i am going to demostrate about the proxy settings in android phone. As there is no UI for proxy settings for android web browser. But the android web browser will read the proxy settings in its settings database. Here is the instructions to enable the proxy in the android web browser. to do this setting you must download SDK package from android you need to check USB Debugging option in phones setting and follow the step given below > adb shell # sqlite3 /data/data/com.google.android.providers.settings/databases/settings.db sqlite> INSERT INTO system VALUES(99,’http_proxy’, ‘proxy:port’); sqlite>.exit You can talk to settings.db for more information. sqlite> SELECT * FROM system; sqlite> .tables sqlite> .databases sqlite> .schema table_name sqlite> more SQL expression to talk to the tables Don’t forget the ‘;’ at the end of the SQL expression.

How to get/find height and width of window using javascript

By knowing heigth and width of window we can place divs, messages,status wherever we want by using top left property of element. for that you should provide value of top and left to view in different monitors to get dynamic top left position you must find out the window width & height. following code will demostrate you to find out the window width & height which supports in  almost all browsers .   function windimension(){ if(window.innerHeight !==undefined) { var width= window.innerWidth; var height=window.innerHeight]; // most browsers } else{ // IE varieties var D= (document.body.clientWidth)? document.body: document.documentElement; var width= D.clientWidth; var height=D.clientHeight; } } Hope this will help u.......

Adding events to DOM Elements in javascript by For IE, Mozilla, Opera browsers

To add events to DOM element Dynamically using javascript needs to write different code for different browsers. Browsers Like Mozilla, Opera support the "W3C DOM Level 2 event binding mechanism"  which uses a function on DOM elements called addEventListener.  Following the way to  add events to DOM element Dynamically for all browser. if (window.addEventListener != null) { // Method for browsers that support addEventListener, e.g. Firefox, Opera, Safari window.addEventListener("focus", FocusFunction, true); window.addEventListener("blur", FocusLostFunction, true); } else { // e.g. Internet Explorer (also would work on Opera) window.attachEvent("onfocus", FocusFunction); document.attachEvent("onfocusout", FocusLostFunction); //focusout only works on document in IE }  Hope this will help you guys........

HTTP Error 500.21 - Internal Server Error - Simple Solution

HTTP Error 500.21 - Internal Server Error Handler "PageHandlerFactory-Integrated" has a bad module "ManagedPipelineHandler" in its module list. If you getting above error after publishing your asp.net application in IIS 7 then following is the simplest solution for you. Go to command prompt. Navigate to C:\Windows\Microsoft.NET\Framework\v4.0.30319 path. Then type aspnet_regiis.exe -i and hit enter. If you got message like "Asp.net installed suuccessfully" then you have done it then. Remember you must have administrator rights to do the above procedure .

Creation of Date Format function using javascript and Jquery

If you want to format the datetime string of database in your html file you need to get help from JavaScript.In javascript there is no pre define function exists to format date time string in dd MMM yyy. To accomplish the above task you need to write custom code. The following  is the custom function by using that you can format your date-time string in dd MMM yyyy format first you need to write array which has all months var gsMonthNames = new Array( 'January', 'February', 'March', 'April', 'May', 'June', 'July', 'August', 'September', 'October', 'November', 'December' ); Then add following function in html file function dFormat(date) { var result = ''; if (date != '') { var dateArray = date.split('/'); if (dateArray.length > 1) { result = dateArray[1] + " " + gsMonthNames[parseInt(dateArray[0])-1] + "

Solution for HTTP Error 500.19 - Internal Server Error

Error Message: HTTP Error 500.19 - Internal Server Error The requested page cannot be accessed because the related configuration data for the page is invalid. Detailed Error Information Module IIS Web Core Notification BeginRequest Handler Not yet determined Error Code 0x80070021 Config Error: This configuration section cannot be used at this path. This happens when the section is locked at a parent level. Locking is either by default (overrideModeDefault="Deny"), or set explicitly by a location tag with overrideMode="Deny" or the legacy allowOverride="false". Config File \\?\C:\inetpub\wwwroot\web.config Requested URL http://localhost:8081/ Physical Path C:\inetpub\wwwroot\ Logon Method Not yet determined Logon User Not yet determined Config Source 144: </modules> 145: <handlers> 146: <remove name="WebServiceHandlerFactory-Integrated"/> Reason: ERROR CODE: 0x80070021 is ERROR_LOCK_VIOLATI

Enable disable all buttons of html form using Jquery

To enable disable all the buttons of html form needs to write lots of code in JavaScript. In JavaScript first we need to find all input elements which having input type submit and store it in array. After storing elements in array needs to loop that array and disable or enable element one by one. Instead of writing lots of code we can use JQuery one line code as follows $('input[type=submit']).attr('disabled',true); The above JQuery code will disable all input elements which having type submit. Happy coding...............

Get value of dropdownlist or html select using Jquery

In Jquery, you need to write one line code to get value of dropdownlist. You can use following code to get value of selected option Var selectvalue=$('#urid').val(); You can use following code to get text of selected option Var selecttext=$('#urid').text(); you are done......   Happy coding...........

Insert Update & Delete using Linq to sql classes

I have learnt last week Linq to sql and i amazed by its features.I would like to share my knowledge with you.To insert,update and delete you need to write lesser amount of code hence it saves development time. Following is the step you need to follow in order to insert,update and delete data of database using Linq to sql in Asp.Net. Open Visual Studio 2008, Click File >Website and choose ASP.Net Website. Choose the language of your choice and name your website according to your need. In solution explorer, right the project and select “Add New Item”. Select “LINQ to SQL classes” as shown in below figure. I have named it as DataClasses1. This will add an EmployeeInfo.dbml file inside “App_Code” folder.    In Visual Studio,   DataClasses1.dbml will have 2 panes. The left pane is for deigning the data objects and the right pane can be used for creating methods that operates on the data objects.The Visual Studio toolbar will contain a new toolbar for designing LINQ to SQL obje

Get LINQ to SQL results into a DataTable in asp.net

Linq to sql is a microsofts powerful tool to develop critical application faster.In Linq to sql the query result is in Generic list of generic  ienumerable type.  If you want result set in DataTable you need to convert this generic list result into datatable. To convert LINQ to SQL results into a DataTable use following Code DataClassesDataContext dc=new DataClassesDataContext(); var results = dc.products.ToList(); DataTable dt = new DataTable(); List<product> lst = results; PropertyInfo[] props= typeof(product).GetProperties(); foreach (var prop in props) { dt.Columns.Add(prop.Name); } foreach (var item in lst) { var rowa = new object[props.Length]; for (int i = 0; i < props.Length; i++) { rowa[i] = props[i].GetValue(item, null); } dt.Rows.Add(rowa); } Gr