Posts

Showing posts from 2014

How to Create a Clickable Map Using Your Own Custom Map Image

you can find co-ordinate of a specific location inside your image map by the help of ms-paint and then put into polygon or circle point. <div style="float:left;width:960px;">         <div style="float: left; width: 960px;">             <img src="~/Images/CampingMap.png" style="width: 930px;" id="CampingMapImg" />             <svg width="930px" height="800px" style="overflow: hidden; position: absolute; top: 0; left: 8px;">                 <polygon fill="#000000" fill-opacity="0.5" stroke="#000000" stroke-width="2" points="878,125 896,125 896,148 878,148" stroke-opacity="1" stroke-linejoin="round" data-campid="818" data-available="false" onclick="CampStatus(this);"></polygon>                 <polygon class="poly_avail" fill="rgba(188, 112, 112, 0.55...

How to debug Windows services in Visual Studio?

Image
Yo can find this solution from http://stackoverflow.com/questions/4678819/how-to-debug-windows-services-in-visual-studio  or http://msdn.microsoft.com/en-us/library/7a50syb3(v=vs.110).aspx You can also try this. Create your Windows service and install and start…. That is, Windows services must be running in your system. While your service is running, go to the  Debug  menu, click on  Attach Process  (or process in old Visual Studio) Find your running service, and then sure the  Show process from all users  and  Show processes in all sessions  is selected, if not then select it. Click the  Attach  button Click  OK Click  Close Set a break point to your desirable location and wait for execute. It will debug automatic whenever your code reaches to that point. Remember, put your breakpoint at  reachable place , if it is  onStart (), then stop and start the service again If your debugger ...

Visual Studio ALL keyboard shortcuts

Ctrl+S Save current file Ctrl+Shift+S Save all files Ctrl+Shift+N Create new project Ctrl+O Open file Ctrl+Shift+O Open project Ctrl+Shift+A Add item to project Esc Close menu or dialog Ctrl+P Print Shift+Alt+Enter Toggle full screen mode Ctrl+F4 Close current tab Ctrl+F6/Ctrl+Shift+F6 Go to next / go to previous window Ctrl+Tab, then Arrow keys Press and hold Ctrl+Tab, then using arrow keys gives a small task manager with all open files and views For keystrokes with two keys such as Ctrl+k+k, keep holding the Ctrl key until releasing the last key. Ctrl+K+K Toogle bookmark Ctrl+K+N Goto next bookmark Ctrl+K+P Goto previous bookmark Ctrl+Shift+K+N Goto next bookmark in folder Ctrl+Shift+K+P Goto previous bookmark in folder Ctrl+K+W Put focus on bookmark window Esc Leave bookmark window and focus on editor Ctrl+K+H Toggle code shortcut at current line* Ctrl+K+L Clear all bookmarks Ctrl+\+T Show Task List (including c...

Chandra Bhushan Prasad: How To Get IP & Locations details of client machin...

Chandra Bhushan Prasad: How To Get IP & Locations details of client machin... : Using JQuery Add this code in head section <script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/j...

How To Get IP & Locations details of client machine in asp.net

Using JQuery Add this code in head section <script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jquery/1.7.2/jquery.min.js"></script>     <script type="text/javascript">         $.get("http://ipinfo.io/66.87.90.80", function (response) {             document.getElementById("<%=Label1.ClientID %>").innerHTML = "";             document.getElementById("<%=Label1.ClientID %>").innerHTML = "IP is : " + response.ip + "<br> Host Name is : " + response.hostname             + "<br> Host Name is : " + response.hostname             + "<br> City Name is : " + response.city             + "<br> Region Name is : " + response.region             + "<br> Country Name is : " + response.country   ...

C# Downloading website into string using C# WebClient or HttpWebRequest

1st Method............ ---------------------------------------- public void ReadPage()     {         HttpWebRequest req = (HttpWebRequest)HttpWebRequest.Create( "https://www.kickass.to/");         req.Method = "GET";         req.UserAgent = "Mozilla/5.0 (Windows; U; MSIE 9.0; WIndows NT 9.0; en-US))";             string source;         var response = req.GetResponse();         var stream = response.GetResponseStream();         try         {             if (response.Headers.AllKeys.Contains("Content-Encoding")                 && response.Headers["Content-Encoding"].Contains("gzip"))             {                 stream = new System.IO.Compression....

Chandra Bhushan Prasad: Concatenate column's in sql server...

Chandra Bhushan Prasad: Concatenate column's in sql server... : declare @s varchar(8000) select @s=coalesce(@s +',"' ,'"') + ProjectName +'"' from ProjectMaster se...

Remove time by datetime in SQL Server

SELECT DATEADD(dd, DATEDIFF(dd, 0, GETDATE()), 0)

How do I get a file size in bytes using .NET?

public string GetFileSize(string filename)     {         string[] sizes = { "B", "KB", "MB", "GB" };         double len = new FileInfo(filename).Length;         int order = 0;         while (len >= 1024 && order + 1 < sizes.Length)         {             order++;             len = len / 1024;         }       return String.Format("{0:0.##} {1}", len, sizes[order]);     }

Subqueries in UPDATE Statements

UPDATE itAppTranslationSkills SET ASS_Specialisations = b.ASS_Specialisations FROM itAppTranslationSkills AS a INNER JOIN itAppSpecialisationSkillsExp AS b     ON a.aid_pk = b.aid_pk  ;

Chandra Bhushan Prasad: How do I find the Client ID of control within an A...

Chandra Bhushan Prasad: How do I find the Client ID of control within an A... : <asp:TemplateField> <ItemTemplate> <asp:TextBox ID = "textDateSent" runat = "server" &gt...

Chandra Bhushan Prasad: How to show help text in page on mouse move

Chandra Bhushan Prasad: How to show help text in page on mouse move : Add this code in aspx.page ------------------------------------------  <a href="#" style="cursor: pointer;" onmous...

How to show help text in page on mouse move

Add this code in aspx.page ------------------------------------------  <a href="#" style="cursor: pointer;" onmousemove="ShowPicture('ChannelsHelpImageStyle1',1)"                                             onmouseout="ShowPicture('ChannelsHelpImageStyle1',0)">                                             <asp:Image ID="proofimg" runat="server" ImageUrl="~/App_Themes/IT/Photo/LanguageSkills_03.png" />                         ...

Scroll page and position at callout box after click on button.

 <%-- aspx code--%> --------------- <input type="button" value="Submit Review"  ValidationGroup="LApproval" class="login-buttonLginpage" onclick="validationCalloutPostionAdjust('LApproval'); showpopup('LApproval');" />  ----------------  <%-- Script --%> function validationCalloutPostionAdjust(validationGroup) {     //To find all the ValidationCallout client behavior     Page_ClientValidate(validationGroup);     var currentBehavior = null;     var allBehaviors = Sys.Application.getComponents();     for (var loopIndex = 0; loopIndex < allBehaviors.length; loopIndex++) {         currentBehavior = allBehaviors[loopIndex];         if (currentBehavior != null) {             //execute the operation of changing the popup's position ...

How to pass textbox id as a parameter to the function in javascrip

<asp:TextBox ID="txtRatingA" runat="server" onblur="ShowRatingDetails(this,1)">0</asp:TextBox> <asp:Label ID="lbltxtRatingDetailsA" runat="server"></asp:Label> <asp:TextBox ID="txtRatingB" runat="server" onblur="ShowRatingDetails(this,2)">0</asp:TextBox> <asp:Label ID="lbltxtRatingDetailsB" runat="server"></asp:Label> <script type="text/javascript">     function ShowRatingDetails(SourceID, Type) {         var inputval = SourceID.value;         var resultval = "";         if (inputval == 1)             resultval = "Unacceptable – Inaccurate";         else if (inputval == 2)             resultval = "Unacceptable (Borderline)";        ...

HOW TO Use the NumericUpDown Control

HOW TO Use the NumericUpDown Control  Great help taken from  http://www.asp.net/ajaxlibrary/HOW%20TO%20Use%20the%20NumericUpDown%20Control.ashx NumericUpDown Demonstration NumericUpDown Description NumericUpDown is an ASP.NET AJAX extender that can be attached to an ASP.NET TextBox control to add "up" and "down" buttons that increment and decrement the value in the TextBox. The increment and decrement can be simple +1/-1 arithmetic, they can cycle through a provided list of values (like the months of the year), or they can call a Web Service to determine the next value. Page authors can also provide custom images to be used instead of the default up/down button graphics. Video - How Do I: Use the ASP.NET AJAX NumericUpDown Control? NumericUpDown Client Code Sample view plain copy to clipboard print ? < script   runat = "server" >        [System.Web.Services.W...

How to Do a Remote Shutdown for a PC on a LAN

Image
Steps 1 Open the command prompt.  This may be done by clicking on the "Start" button, and selecting "Run". Ad 2 Type in  cmd  and press Enter. 3 Type in  shutdown -m \\computername , replacing "computername" with the name of the computer you wish to shutdown or the computer's IP address. 4 Experiment with the shutdown command's switches. -r  will force a restart, disabling any services or user interaction from interrupting it. -c  "comment" will force a comment to appear on the system being shutdown. -t xx  will force a timeout for "xx" seconds. For example,  -t 60  would perform a shutdown after a 60-second timeout. -a  will abort the shutdown. A full command example:  shutdown -m \\myserver -r -c "This system will shutdown in 60 seconds" -t 60 5 Try another method: Type  shutdown -i  in the run window. Click the "Add" box and type the name of the computer ...