Posts

fancybox on google map marker example

Image
FancyBox is a tool for displaying images, html content and multi-media in a Mac-style "lightbox" that floats overtop of web page.  This example will show how to use Google Map Marker With Fancybox. You can see my previous post about Creating Google Map API Zoom the marker This is the requirement for this example : Jquery Script - you can get it here fancybox script pack - you can get it here fancybox css - you can get it here html page and of course the Google Map Script Header on html page * The header should link with jquery and fancybox script. I will put Google Marker script at header also. <script type="text/javascript" src="jquery-latest.min.js"></script> <script type="text/javascript" src="jquery.fancybox.pack.js"></script> <link href="jquery.fancybox.css" type="text/css" rel="StyleSheet" /> <script src="https://maps.googleapis.com/maps/api/js?v=3.exp&sensor...

How to remove a MenuItem base on condition

There may be an easier solution, which is to use the MenuItemDataBound event. I use this to hide menu nodes from the Menu Controller . Keeping them in the siteMap allows them to appear in the Menu Controller , but I don't want them in the Menu Controller based on the Roles attribute . Here's my code: The SiteMap File <?xml version="1.0" encoding="utf-8" ?> <siteMap xmlns="http://schemas.microsoft.com/AspNet/SiteMap-File-1.0" >     <siteMapNode url="" title=""  description="">         <siteMapNode url="#" title="Home" roles="*"  description="This is Homepage" />         <siteMapNode url="" title="About" roles="*"  description="This About Page" />         <siteMapNode url="_#" title="Product" roles="ADMIN" description="This is Product Page, Only Role Admin Can access"...

Get Files from Directory - C#

This example shows how to get list of file names from a directory (including subdirectories). You can filter the list by specific extension. To get file names from the specified directory, use static method Directory.Get­Files . Lets have these files and subfolders in „c:\MyDir“ folder: Get files from directory Method Directory.GetFiles returns string array with files names (full paths). using System.IO; string [] filePaths = Directory .GetFiles ( @"c:\MyDir\" ); // returns: // "c:\MyDir\my-car.BMP" // "c:\MyDir\my-house.jpg" Get files from directory (with specified extension) You can specify search pattern. You can use wildcard specifiers in the search pattern, e.g. „*.bmp“ to select files with the extension or „a*“ to select files beginning with letter „a“. string [] filePaths = Directory.GetFiles(@"c:\MyDir\", "*.bmp"); // returns: // "c:\MyDir\my-car.BMP" Get files from directory (including all subdirectories) If you want ...

ASP.NET - MSSQL Server Database Timeouts

Image
One of the most disturbing aspect of most database applications is connection timeouts. Most of us might have faced this at one time or other. It would be helpful if we have complete control over the timeout and execution of our database queries/procedures. There are 3 different places that you need to check if you face a timeout in your application. Let us say, you have an application that runs a lengthy stored procedure and you started getting a timeout error. You tried to optimize the procedure to the maximum possible extend. At this stage, it is desirable to have a way to extend the timeout so that the user will see the results even after waiting for a little longer. Database Timeout Settings The first place that you need to check is your database server, to see if the server accepts long running queries/procedures. You can do this by checking the properties of the database. If you are using enterprise manager right click on the server name and select properties....

C# Method to Convert ASCII to EBCDIC vice versa

This example show convertion between ASCII character to EBCDIC character and EBCDIC to ASCII. ASCII To EBCDIC public string ConvertASCIItoEBCDIC(string strASCIIString) {      int[] a2e = new int[256]      {         0, 1, 2, 3, 55, 45, 46, 47, 22, 5, 37, 11, 12, 13, 14, 15,         16, 17, 18, 19, 60, 61, 50, 38, 24, 25, 63, 39, 28, 29, 30, 31,         64, 79,127,123, 91,108, 80,125, 77, 93, 92, 78,107, 96, 75, 97,         240,241,242,243,244,245,246,247,248,249,122, 94, 76,126,110,111,         124,193,194,195,196,197,198,199,200,201,209,210,211,212,213,214,         215,216,217,226,227,228,229,230,231,232,233, 74,224, 90, 95,109,         121,129,130,131,132,133,134,135,136,137,145,146,147,148,149,150,  ...

7 way to convert DataTable to generic List - C#

Conversion DataTable to Generic List<t>. We can do it in various way. Solution 1: DataTable dt = CreateDataTable(); List<datarow> list = new List<datarow>(); foreach (DataRow dr in dt.Rows) {      list.Add(dr); } Solution 2: DataTable table = new DataTable { Columns = { {"Foo", typeof(int)}, {"Bar", typeof(string)} } }; for (int i = 0; i < 5000; i++) {      table.Rows.Add(i, "Row " + i); } List<T> data = new List<t>(table.Rows.Count); foreach (DataRow row in table.Rows) {       data.Add(new T((int)row[0], (string)row[1])); } Solution 3: Using Linq expression. It return data in List<t>. List<string> list =dataTable.Rows.OfType<datarow>().Select(dr => dr.Field<string>(0)).ToList(); Solution 4: Using Linq/lamda expression. List<employee> list= new List<employee>(); list = (from DataRow row in dt.Rows select new Employee {      FirstName = row["ColumnName"].To...

Configure IIS 7.5 to manage ASP.NET 4.0 web pages

Image
Problem Solution After installing .NET Framework 4.0 on a machine there is a few configuration changes you need to do to IIS in order to get a ASP.NET 4.0 page running. First set the Application pool to run in ASP.NET v4.0 “mode”. Then you need to allow ASP.NET v4.0.x to run. This is done in the ISAPI and CGI Restrictions found on the server level. Follow The picture below to make it done.. 1) 2 ) 3) 4) Select the same version you have installed on your server, (32 bit or 64 bit). And change to Allowed.  By Mohd Zulkamal NOTE : – If You have Found this post Helpful, I will appreciate if you can Share it on Facebook, Twitter and Other Social Media Sites. Thanks =)