TipsOnLips.net

Your .net tips and tricks source

About the author

Author Name is someone.
E-mail me Send mail

Recent comments

Authors

Disclaimer

The opinions expressed herein are my own personal opinions and do not represent my employer's view in anyway.

© Copyright 2010


Failed to create database 'DevelopmentStorageDb20090919' DSInit Windows Azure Error

You may get an error when Visual Studio or the Windows Azure SDK tries to create a storage database by default. Therefore the fix is to open the DSInit.exe via the visual studio command promot using this script: DSInti /sqlInstance:YourInstanceName. The DSInit location usually in C:\Program Files\Windows Azure SDK\v1.0\bin\devstore.

Categories: Azure
Posted by developer on Monday, November 23, 2009 3:27 AM
Permalink | Comments (2) | Post RSSRSS comment feed

Javascript best definition of the keyword 'this'

Nettuts+ have an excellent article about Javascript object oriented programming and they came up with a very clear definition to the keyword 'this' as below:

So what does ‘this’ reference? Well in a browser, ‘this’ references the window object, so technically
the window is our global object. If we’re inside an object, ‘this’ will refer to the object itself however
if you’re inside a function, this will still refer to the window object and likewise if you’re inside a method
that is within an object, ‘this’ will refer to the object.

>Due to our scope chain, if we’re inside a sub-object (an object inside an object), ‘this’ will refer to
the sub-object and not the parent object.

Read Source Article


Categories: JavaScript
Posted by developer on Thursday, November 12, 2009 10:32 PM
Permalink | Comments (0) | Post RSSRSS comment feed

Find a label control in the EmptyDataTemplate of the ASP.NET ListView Control

        protected void lstListView_DataBound(object sender, EventArgs e)

        {

            if (lstListView.Controls[0].FindControl("lblInsertHeader").IsNotNull() &&

lstListView.Items.Count == 0)

            {

                ((Label)lstListView.Controls[0].FindControl("lblInsertHeader")).Text = this.Header;

            }

        }


Categories: ASP.NET | C#
Posted by developer on Tuesday, November 10, 2009 10:16 PM
Permalink | Comments (1) | Post RSSRSS comment feed

Hiding a column in ASP.NET ListView

Source: http://stackoverflow.com/questions/70758/does-anyone-know-of-a-way-of-hiding-a-column-in-an-asp-net-listview


Categories: ASP.NET | C#
Posted by developer on Tuesday, November 10, 2009 3:17 AM
Permalink | Comments (0) | Post RSSRSS comment feed

ASP.NET ListView Control - Get Selected Keys/Checkboxes

If we need to get all the selected keys for each ListViewDataItem based on a selected checkbox, this is how its done:

 <asp:ListView ID="lstDocuments" runat="server" DataKeyNames="templateid">

  .....

</

asp:ListView>

 

 

public IList<string> GetSelectedTemplates()

{

     IList<string> selectedTemplates = new List<string>();

 

     foreach (ListViewDataItem item in lstDocuments.Items)

        {

            if (item.ItemType == ListViewItemType.DataItem)

            {

               CheckBox checkbox = (CheckBox)item.FindControl("chkSelect");

               if (checkbox.Checked)

               {

               selectedTemplates.Add((string)lstDocuments.DataKeys[item.DataItemIndex].Value);

               }

            }

        }

 

    return selectedTemplates;

}

 

 

 

 


Categories: ASP.NET | C#
Posted by developer on Tuesday, November 10, 2009 1:50 AM
Permalink | Comments (1) | Post RSSRSS comment feed

WCF ABC

  • "A" stands for Address: Where is the service?
  • "B" stands for Binding: How do I talk to the service?
  • "C" stands for Contract: What can the service do for me?

  • Categories: WCF
    Posted by developer on Friday, October 23, 2009 3:31 AM
    Permalink | Comments (1) | Post RSSRSS comment feed

    Get Number Of DOM Elements using JavaScript

    The number of DOM elements is easy to test, just type in Firebug's console:
    document.getElementsByTagName('*').length

    Other sources: http://getfirebug.com/console.html

    Categories: HTML
    Posted by developer on Tuesday, October 20, 2009 10:59 PM
    Permalink | Comments (1) | Post RSSRSS comment feed

    C# Replace single quotation with double quotation

    A_string.Replace("'", "\"")


    Categories: C#
    Posted by developer on Saturday, October 03, 2009 12:18 AM
    Permalink | Comments (3) | Post RSSRSS comment feed

    JQuery Resources 2009 Q4

    1. Easy XML Consumption using jQuery
    2. Reading XML with jQuery 

    Categories: JavaScript | Jquery
    Posted by developer on Thursday, September 24, 2009 11:51 PM
    Permalink | Comments (2) | Post RSSRSS comment feed

    Ajax and JQuery CDNs (Microsoft and Google)

                 Source: http://www.asp.net/ajax/cdn/

    • Google
      • JQuery min(<script src="http://ajax.googleapis.com/ajax/libs/jquery/1.3.2/jquery.min.js" type="text/javascript"></script>)
      • JQuery (<script src="http://ajax.googleapis.com/ajax/libs/jquery/1.3.2/jquery.js" type="text/javascript"></script>)
      • JQuery UI min(<script src="http://ajax.googleapis.com/ajax/libs/jqueryui/1.7.2/jquery-ui.min.js" type="text/javascript"></script>)
      • JQuery UI(<script src="http://ajax.googleapis.com/ajax/libs/jqueryui/1.7.2/jquery-ui.js" type="text/javascript"></script>)

          http://code.google.com/p/jqueryjs/downloads/detail?name=jquery-1.3.2-vsdoc2.js


    Categories: Ajax | Jquery
    Posted by developer on Friday, September 18, 2009 7:30 AM
    Permalink | Comments (5) | Post RSSRSS comment feed