Wednesday, September 22, 2010

Live Sync - How to map a drive letter to your network path



Map a drive letter to your network path
right click on the network folder, and select "Map Network Drive", I named it N:

In the Windows Live Sync website, find a shared folder, select "Add a computer", and
select your computer

Select your C: then a folder with a short name like C:\temp

In the website URL, rename "C" with your network drive letter
there are two places one after "bpath" and one after "blabel"

In the website URL, replace the folder name you selected with the folder name on your network path -- after "rpath"

Press ENTER or click on the GO button of the browser to show the new path in the screen

Now you can continue with folder setup as normal


Source:
http://connect.microsoft.com/LiveMesh/feedback/details/404603/sync-allow-network-folders-to-be-added-to-the-mesh




Debugging AJAX in VS



To debug Ajax you have to do it as the code is executing in the browser.
You write out a debug message using Sys.Debug.trace.
Your page must include the Microsoft AJAX Library JavaScript file. This is done by adding a ScriptManager control to your page.

The following code shows part of an .aspx page that includes a ScriptManager control and a JavaScript function named button1_onclick.
When this function is fired (from the user clicking button1), the trace method is called.











You can view the trace messages output by the AJAX library in the Visual Studio Output window.




Thursday, September 16, 2010

Auto-replay slides in power point (Indefinite Loop)



It is possible to loop a power point presentation until we press a key on the keyboard:
  1. Set up the animations on slide 1
  2. Give this slide an auto transition zero secs
  3. Create a custom show with just this slide (slide show >custom shows . new)
  4. Add an action button to hyperlink to "slide 2" (not next)
  5. In slide show > setup show choose 'loop till esc'
  6. Show Slides > custom show
  7. Play and click the action button to move on



Friday, September 10, 2010

A back button for ASP.NET pages



In order to implement a back button in ASP.NET we need to use Java Script history object and avoid the Post Back, the code below is the solution for this problem:



<asp:Button ID="button_history_back"
runat="server"
Text="Back"
CausesValidation="false"
OnClientClick="Javascript:history.go(-1); return false;"
/>




Thursday, September 2, 2010

Windows Installer is not included in any selected prerequisite




If you are working on a setup project and you get the warning:
Windows Installer is not included in any selected prerequisite

This means you need to add a prerequisite to you application, in order to fix it follow these steps in visual studio:

  1. In the solution explorer, right-click on your deployment project and select Properties;
  2. A window titled " Property Pages" should appear
  3. Click on the Prerequisites... button
  4. Select a package that installs Windows Installer 2.0
  5. Click OK button and re-build again.

This should remove the warning





Wednesday, September 1, 2010

Page Life Cycle Events in ASP.NET

EventDescription
PreInitThis is the first real event you might handle for a page. You typically
use this event only if you need to dynamically (from code) set
values such as master page or theme.
This event is also useful when you are working with dynamically
created controls for a page. You want to create the controls inside
this event.
InitThis event fires after each control has been initialized. You can use
this event to change initialization values for controls.
InitCompleteRaised once all initializations of the page and its controls have
been completed.
PreLoadThis event fires before view state has been loaded for the page
and its controls and before PostBack processing. This event is useful
when you need to write code after the page is initialized but
before the view state has been wired back up to the controls.
LoadThe page is stable at this time; it has been initialized and its state
has been reconstructed. Code inside the page load event typically
checks for PostBack and then sets control properties appropriately.
The page’s load event is called first. Then, the load event for each
child control is called in turn (and their child controls, if any). This
is important to know if you are writing your own user or custom
controls.
Control (PostBack) event(s)ASP.NET now calls any events on the page or its controls thatcaused the PostBack to occur. This might be a button’s click event,for example.
LoadCompleteAt this point all controls are loaded. If you need to do additional
processing at this time you can do so here.
PreRenderAllows final changes to the page or its control. This event takes place after all regular PostBack events have taken place. This event takes place before saving ViewState, so any changes made here are saved.
SaveStateCompletePrior to this event the view state for the page and its controls is set. Any changes to the page’s controls at this point or beyond are ignored. This is useful if you need to write processing that requires the view state to be set.
RenderThe Render method generates the client-side HTML, Dynamic Hypertext Markup Language (DHTML), and script that are necessary to properly display a control at the browser. This method is useful if you are writing your own custom control. You override this method to control output for the control.
UnLoadThis event is used for cleanup code. You use it to release any managed resources in this stage. Managed resources are resources that are handled by the runtime, such as instances of classes created by the .NET common language runtime.