Category: Programming



ASP.NET 4 includes a feature called SQL cache invalidation. Before ASP.NET 2.0, cachingthe results that came from SQL Server and updating the cache based on a time interval was possible — for example, every 15 seconds or so.

This meant that the end user might see stale data if the result set changedsometime during that 15-second period.In some cases, this time interval result set is unacceptable. In an ideal situation, the result set stored in thecache is destroyed if any underlying change occurs in the source from which the result set is retrieved — inthis case, SQL Server.

With ASP.NET 4, you can make this happen with the use of SQL cache invalidation.This means that when the result set from SQL Server changes, the output cache is triggered to change, andthe end user always sees the latest result set. The data presented is never stale.


ASP.NET COUNTDOWN TIMER . .


Paste the following code in header  . .

<div id=”timelabel”></div>

<script type=”text/javascript”>

var leave = <%=seconds %>;
CounterTimer();

var interv=setInterval(CounterTimer,1000);
function CounterTimer()

{

var day = Math.floor(leave / ( 60 * 60 * 24))

var hour = Math.floor(leave / 3600) – (day * 24)

var minute = Math.floor(leave / 60) – (day * 24 *60) – (hour * 60)

var second = Math.floor(leave) – (day * 24 *60*60) – (hour * 60 * 60) – (minute*60)
hour=hour<10 ? “0″ + hour : hour;

minute=minute<10 ? “0″ + minute : minute;

second=second<10 ? “0″ + second : second;
var remain=day + ” days   “+hour + “:”+minute+”:”+second;

leave=leave-1;
document.getElementById(“timelabel”).innerText=remain;
}

</script>

</body>

</html>

————————

Code Behind . . .

using System;

using System.Collections.Generic;

using System.Linq;

using System.Web;

using System.Web.UI;

using System.Web.UI.WebControls;

using System.IO;
namespace tests{
public partial class _Default : System.Web.UI.Page

{

public double seconds;

protected void Page_Load(object sender, EventArgs e)

{

seconds = (GetEndTime() – GetStartTime()).TotalSeconds;

}

private DateTime GetStartTime()

{            return DateTime.Now;        }

private DateTime GetEndTime()        {            return new DateTime(2011, 8, 23, 8, 10, 0);        }

}

}

Thank you . .


Boy oh boy! This is one tablet that I am dying to try my hands on, especially after the entire buzz it created at the Consumer Electronics Show, Las Vegas. From the title of the post you might have already guessed that I am talking about Motorola Xoom.The online retailer Infibeam has mentioned that it is releasing the tablet on May 10, 2011 at a pre-order price of Rs. 35000.

As the market continues to get inundated with all new range of tablets, the launch of any new tablet has now become a routine affair. But there is something special about Motorola Xoom that makes its release worth a wait. Touted as the most worthy competitor to Apple IPad (and IPad2), Xoom happens to be Google’s inaugural Honeycomb tablet- and the device that the Honeycomb team actually used to test the software. In that manner, Xoom imbibes in itself the true essence of Android Honeycomb platform, the platform that is specifically designed for tablets.

The specifications look equally impressive. Powered by a dual-core 1GHz Nvidia Tegra SoC processor and 1GB DDR2 RAM, the 10.1-inch (display) tablet clear beats the first generation IPads in certain respects. The device also houses a 2 megapixel front facing camera, a 5 megapixel camera at back panel with 720p HD video record feature, Wi-Fi, gyroscope, accelerometer, barometer and an e-Compass. The battery is powerful enough to support 10 hours of video (and up to 75 hours of music) and the company has also promised a software update that will enable Flash support for the device, something that misses from the entire IPad series.

The Big question: should you buy it?

Motorola Xoom, no doubt is an exciting device. Having said that, there are some points that you should keep in mind before actually buying it.

1) The IPad2 factor: Remember, Motorola Xoom was conceptualized before Apple IPad2 was announced. Xoom, as I mentioned earlier, beats the first generation IPad in certain aspects but not the new IPad2, the one with modified looks, refurbished features and a more powerful processor. However, the availability of IPad2 in India is still not clear and there has been no official word on it so far. So if you don’t want to wait too long, Xoom is the way to go.

2) The price factor: Xoom is available at a price of Rs. 35000. We are expecting 2011 to be the year of tablets and that could mean a flurry of lower-priced alternative, but equally good tablets in the market. So the question is whether you are willing to wait for an unknown amount of time so as to save few hundred bucks. Anyhow, it’s more of a personal judgment.

3) The Android Honeycomb factor: Motorola Xoom was launched in the US markets on 24 Feb 2011 with a very high expectation. But the expectations were not fully met and the sales were weak despite the initial buzz amongst the users. And quite contrary to the expectations, some analysts announced Android 3.0 Honeycomb to be the weakest link. According to them, Honeycomb is “extremely complicated and confusing” and not suitable for mass adoption. The reviews might seem to be little extreme but it is enough to create some doubt in the mind of a potential buyer.

Anyway, I think that it is always better to get the feel of the device first before actually buying it and since the device will now be available in India, you might get a chance to explore it.

So what do you think about the prospects of Motorola Xoom in India? What strategy are you going to adopt- buy it immediately or stick to wait-and-see approach? Both ways, do let us know your reviews in the comments.

DateTime Formats . . (.NET)


DateTime.Now; 3/14/2011 12:45:24 AM
DateTime.Now.ToString(); 3/14/2011 12:45:24 AM
DateTime.Now.ToShortTimeString() 12:45 AM
DateTime.Now.ToShortDateString() 3/14/2011
DateTime.Now.ToLongTimeString() 12:45:24 AM
DateTime.Now.ToLongDateString() Monday, March 14, 2011

DateTime.Now.ToString(“d”) 3/14/2011
DateTime.Now.ToString(“D”) Monday, March 14, 2011
DateTime.Now.ToString(“f”) Monday, March 14, 2011 12:45 AM
DateTime.Now.ToString(“F”) Monday, March 14, 2011 12:45:24 AM
DateTime.Now.ToString(“g”) 3/14/2011 12:45 AM
DateTime.Now.ToString(“G”) 3/14/2011 12:45:24 AM
DateTime.Now.ToString(“m”) March 14
DateTime.Now.ToString(“r”) Mon, 14 Mar 2011 00:45:24 GMT
DateTime.Now.ToString(“s”) 2011-03-14T00:45:24
DateTime.Now.ToString(“t”) 12:45 AM
DateTime.Now.ToString(“T”) 12:45:24 AM
DateTime.Now.ToString(“u”) 2011-03-14 00:45:24Z
DateTime.Now.ToString(“U”) Monday, March 14, 2011 5:45:24 AM
DateTime.Now.ToString(“y”) March, 2011
DateTime.Now.ToString(“dddd, MMMM dd yyyy”) Monday, March 14 2011
DateTime.Now.ToString(“ddd, MMM d “‘”yy”) Mon, Mar 14 ’11
DateTime.Now.ToString(“dddd, MMMM dd”) Monday, March 14
DateTime.Now.ToString(“M/yy”) 3/11
DateTime.Now.ToString(“dd-MM-yy”) 14-03-11

Thank you . .


You might have seen floating content of web sites which is always visible on the page even if you scroll it. This is easy achieve thing by using just CSS. However there is also JavaScript alternative for this but the CSS one is smoother and faster as this doesn’t includes any run time calculation. The below step by step process will guide to how to add a always visible div on web page.

<style type=”text/css”>

<!–.visibleDiv

{    position: fixed;}

//–>

</style>
<style type=”text/css”>

<!–/*For top left*/

.visibleDiv

{    top: 10px;    left: 10px;}
/*For top right*/

.visibleDiv{    top: 10px;    right: 10px;}
/*For bottom left*/

.visibleDiv{    left: 10px;    bottom: 10px;}
/*For bottom right*/

.visibleDiv

{    bottom: 10px;

right: 10px;

}

//–>

</style>

 

Thank you . .


1. The only things that you can pass between web sites are string values.

2. The other web site has to give you the names of the values that they will accept.

3. This passes values to PayPal.
1. Add each hidden variable needed as follows:

<input type=”hidden” id=”OrderID” runat=”server”>
2. The button that will submit values to the external site:

<input type=”button” onclick=”javascript: submitToPayPal(‘http://www.paypal.com/cgi-bin/webscr’);” value=”Submit to PayPal” >
3. Add the necessary JavaScript to the page:

<script type=”text/javascript”><!–function submitToPayPal(formAction){ var formElementsArray = document.getElementsByTagName(‘FORM’);   if ( formElementsArray != null )  {   var formElement = formElementsArray[0];
document.getElementById(‘__EVENTTARGET’).value = ‘ ‘;  document.getElementById(‘__EVENTARGUMENT’).value = ‘ ‘;  document.getElementById(‘__VIEWSTATE’).name = ‘NOVIEWSTATE’;
formElement.action = formAction;  formElement.submit();  }}// –>

 

</script>

Warm regards. .

Sameer

 

Why should one use MS.NET for software development?


sameer

Microsoft

 

Well, most of the software development all over the world is done on and for Microsoft Windows Operating System. Dot Net is now the standard software development environment for the Microsoft Windows operating system.  It dramatically simplifies the development of windows, web based, data access applications, components, controls and web services. Dot net comes with amazing features like XML configuration, reflection, and attributes to ease the overall software development life cycle.  Finally, the dot net is supported by the Microsoft Visual Studio Integrated Development Environment; the best IDE available for any software development environment. Visual Studio .NET (VS.NET) supports all the areas of software development from project creation to debugging and installation.

 

Thank you . .


Rule number one : don’t screw around with the browser of your enduser. Say that you were able to filter out the print menu item. What about the keyboard combination ctrl + P? You could override that again with some javascript but that only leaves the enduser clueless as you’re overriding standard functionality and that’s a big nono.

Besides that, you’re using javascript. That can be turned off by an enduser and then your clipboard erasing script also doesn’t work anymore. Poof and there goes your protection level.

try it . .

Thank you


for firefox try as below:

 

    • 1

      Make sure the new media player is installed on your computer. Popular media players include Real Player, QuickTime, Windows Media Player and WinAmp.

    • 2

      Open Mozilla Firefox and click “Tools” and then “Options” on the main menu.

    • 3

      Click the “Applications” tab. Scroll down on the list of file types until you find all of your media file types, including playlists, audio and videos.

    • 4

      Select the “Action” column box next to each of your media file types. You will see a drop-down box.

    • 5

      Change your default media player for each file type by clicking “Use other.” Choose “Always Ask” from the list if you want the browser to ask you every time which media player you want to use, or choose “Save File” if you want to automatically save the file to your computer instead of opening it.

    • 6

      Press “OK” to close the dialog box. Close and restart your browser to activate the new settings. Click on a song or video file in your browser to make sure it recognizes your choice from Step 4 and opens the file in your new default media player.

Thank you . .

Google Maps Control for ASP.NET


Hay guys ,

I am going to implement these kind of features in my project . . .

http://www.codeproject.com/KB/custom-controls/Google-Maps-User-Control.aspx

Features

  • Enables you to draw Google maps. No JavaScript knowledge required. Just drag and drop a control on your page.
  • Uses AJAX calls to retrieve server-side data.
  • Enables you to change pushpin positions on the fly. No need to refresh the full map.
  • Enables you to change pushpin icons on the fly.
  • Optimized to give you the best performance, i.e., only those pushpin data will be retrieved from the server that have changed.

Sameer Kulkarni . .

%d bloggers like this: