Posts

Showing posts with the label Browser compatible

How to Get/Set date time according to Different Time zones in C#

Image
Download code example In an Asp.net application I have developed a Forum in which I have requirement to show date and time according to the time zone of PC on which it is running, I had searched for too many examples on but all are using too complex java scripts and other methods to convert time into local time zone. Finally I decided to make my own solution for this problem My solution is using “TimeZoneInfo” to convert the data to local time zone, this class allow me to convert time according to any time zone, but again I got another problem which is how to take time zone of browser. Again I search on net and finally come out with a code. <script language="javascript" type="text/javascript">     function genarateDateValue()     {                      var d = new Date()             ...

How to pass server values to Javascript using Eval()

In my application I have a target to show message if user does not have permission to navigate to another page. I can do this by using server code but it will make a round trip to server and make a bad user experience so, I decided to use java script. Following is the function of Java Script <script language="javascript" type="text/javascript"> function func_Message(obj) { if (parseFloat(obj)>0) { return true; } else { alert("Please assign a value before viewing the details"); return false; } } </script> And following is the code of Link Button from where I am passing value to Java Script Function <asp:LinkButton ID="lnk_Details" runat="server" Text="Details" CommandArgument='<%# Eval("festi_id") +"~" + Eval("user_id") %>' CommandName="ViewDet...

Auto Complete Example in Asp.net C#

There are too many methods to make an auto complete text box in asp.net You can use JQuery ( Use jquery for Auto Complete ), Ajax Auto complete extender and so on. If you will search on internet you will find so many examples which are using JQuery or Ajax Extender to show auto complete on websites. I had searched on many sites I had tried so many examples to populate auto complete list but, unfortunately, I am not able to find an efficient auto complete example. Finally after searching for many hours I had decided to write my own code. My example is using an asp.net C# to show auto complete. Here, code goes Download Code Run and try typing some numbers or text. You will find an auto complete list on page

How to Debug JavaScript Using C#

Image
Client Java Script is one of the most important things in web development but not the best and easiest to develop. Building of bigger and more complicated scripts, especially using DOM model or form field values can cause a lot of frustration and head pain. Moreover, JavaScript debugging is not easy and obvious as should be. But there is a hope. Before start, we should ensure that client script debugging is not disabled in IE as it is by default. Suitable options are located on advanced tab of Internet Options where both script debugging checkboxes should be unchecked. Go to Tools>>Options >> and refer image below. You can also download code from http://www.4shared.com/file/106977680/64e2c2b2/DebugJavascript.html Now open your code and put Debugger; key word in your code. Refer image below Now run your code, on IE. You will find and window. Refer image below. Click yes to start debugging. It will take some time to open debu...

Client side validations in C# using javascript

Client-side validation uses the same error display mechanism as server-side checking. Validating input data on web pages is usually a function performed by the server. The web page allows the user to enter data, and when the Submit button is pressed, the browser wraps up the data into an HTTP request and sends it to the server. The server checks each data field to make sure it is valid, and if any problems are found, a new form along with error messages is sent back to the browser. Wouldn't it be much more useful if problems could be detected in the browser before a server request is made? This approach would provide two primary advantages. It would lighten the load on the server, and, more importantly, it would notify the user of a problem with a data field almost immediately after he or she entered the bad data. This supports the truism that errors are cheapest to fix the closer the detection is to the original creation of the error. For example, if there is a problem with a zip ...

How to show icon in browser header / Fevicon

To complete this task you have to visit http://www.html-kit.com/favicon/ Provide your image which you want to use a icon it will generate icon for you. Follow the steps given in site. Write following code in header section of page. <link rel="shortcut icon" href="Images/favicon.ico" type="image/ico"> <link rel="shortcut icon" type="image/ico" href="Images/favicon.ico">

Convert Video to .Flv Using c#.net on Web.

The actual post has shifted. Please click here to visit actual post.

How to show images with Animation

You will find so many scripts to do the same task but, only one issue will arise with all the scripts “does these are browser compatible”. May the answer is yes or may be no. But, here is the solution you have to use “SpryEffects.js”. This is truly browser compatible is easy to implement. I have a small example that is using this “JS” to animate images. Download “SpryEffects.js” from net. <script language="javascript" type="text/javascript"> function MM_effectGrowShrink(targetElement, duration, from, to, toggle, referHeight, growFromCenter) { Spry.Effect.DoGrow(targetElement, {duration: duration, from: from, to: to, toggle: toggle, referHeight: referHeight, growCenter: growFromCenter}); } function showimage(str_path) { var obj=document.getElementById("a1"); str_path=str_path.replace('images/','images/large/'); var int_left=screen.width; if (int_left>1024) { int_left=int_left-1024; ...

Convert Video to .Flv Using c#.net on Web.

Having trouble playing .flv in IIS click here for solution Having trouble Setting up IIS click here for solution The method to convert video to .flv is too easy. You can download following files from .net 1)ffmpeg.exe 2) ffplay.exe 3) pthreadGC2.dll After downloading all the files Follow the steps written:- 1)Make a new .net web site or windows application. 2)Copy and paste all the 3 above written files to root location 3)Copy and Paste code written below 4)Put an upload to page and rename to “ fileuploadImageVideo” 5)put and button and rename to btn_Submit 6)Make 3 folders OriginalVideo, ConvertVideo, Thumbs 7)Import Class “using System.IO;” private bool ReturnVideo(string fileName) { string html = string.Empty; //rename if file already exists int j = 0; string AppPath; string inputPath; string outputPath; string imgpath; AppPath = Request.PhysicalApplicationPath; //Get the application path inputPath = AppPath + "OriginalVideo"; ...

How to use Hindi fonts on Website

Now in current world the importance of multi lingual websites has increased. People demands for sites in different languages for different uses. I have a site on which I have to show data in Hindi. This had become a major issue while development. I had searched the internet and found a solution named Microsoft WEFT. I was very happy to find a solution. I start working on the basis of this software. But after successful launch of website the use had found an major issue. The .eot files are only supported on IE browsers. Now, this is the time to work like a machine to search for a true solution. I have searched many sites. But, finally god give me the solution by giving me the concept of UNICODE fonts Here is the example how to use UNICODE fonts. use these sites to make entry in hindi http://utopianvision.co.uk/hindi/write/ http://www.geocities.com/matthewblackwell/hindiEditor.html You can make entry in hindi for ex. on this http://utopianvision.co.uk/hindi/write/ in second text box ente...

Browser compatible Javascript.

If you want to navigate form one window to another use window.location='pagename.htm' This is a browser compaitable script. I will continue to post more browser compaitable scripts as I will come to know more issue or get request from someone