Posts

Showing posts from September, 2014

Pop up image when anchor clicked using jquery

download Files Examples To popup an image give the anchor tag around the image this class: "hs-rsp-popup" Example: <a href="image.png" class="hs-rsp-popup"><img src="image.png" alt="image"/></a> For an iframe, set the srct of the iframe and use the class "iframe" combined with "hs-rsp-popup" : <a href="http://www.youtube.com/watch?hl=en-GB&v=2WNrx2jq184&gl=GB" class="hs-rsp-popup iframe" title="Bird is the word">Watch this</a> You can also use this to show html content. For local content just use the id of the element for the href: <a href="#elementid" class="hs-rsp-popup hiddendiv">click here</a> <div id="elementid" style="display:none">Hello, World!</div> For remote content, link to the page, for example: <a href="http://www.hotscot.net" class="hs-rsp-

Convert a LINQ Resultset to a DataTable

public DataTable LINQToDataTable (System.Data.Linq. DataContext ctx, object query) {      if (query == null )      {           throw new ArgumentNullException ( "query" );      }           IDbCommand cmd = ctx.GetCommand(query as IQueryable );      SqlDataAdapter adapter = new SqlDataAdapter ();      adapter.SelectCommand = ( SqlCommand )cmd;      DataTable dt = new DataTable ( "table" );      try      {           cmd.Connection.Open();           adapter.FillSchema(dt, SchemaType .Source);           adapter.Fill(dt);      }      finally      {           cmd.Connection.Close();      }      return dt; } --------------------------------------------------------------- Example : To use this method, just use the following code sample: --------------------------------------------------------------- var vrCountry = from country in objEmpDataContext.CountryMaster                         select new {country.CountryID,country.CountryName}; DataTable dt