home

my blog

check me out!

.NET 4.1: System.QuantumEntanglement Community Technology Preview

clip_image010

The String or the Cat: A New .NET Framework Library

For years applications have been built that accept user input. Most user input starts out as a string. Strings are a universal representation of arbitrary data coming into a computer. However, most data does not remain as a string for very long. User input often ends up getting parsed or converted into another data type, such as an integer, Boolean value, or a date.

The concepts presented here are based on a thought experiment proposed by scientist Erwin Schrödinger. While an understanding of quantum physics will help to understand the new types and APIs, it is not required.

 

Read more…

Enable Asp.Net on IIS7 on Windows Vista

IIS7-Asp-net

Now, IIS7 is not installed by default, and the default IIS configuration only serves static files with anonymous authentication.

It does not serve CGI, ISAPI, ASP, ASP.Net, PHP, Perl, etc -- nothing other than static HTML. This is the secure "default" configuration.

Turning on Asp.Net on IIS.7 is very easy:

Open Control Panel --> Programs and Features --> Turn Windows Features on or off --> Internet Information Services --> World Wide Web Services --> Application Development Features --> ASP.Net <-- check here

 

This steps were not required on previous versions of IIS.

More details here.

How to: Insert javascript in Content Pages

In your Master page you would have something like this:

<head runat="server">
...
<asp:ContentPlaceHolder ID="htmlHead" runat="server" />
...
</head>

Then in your content page you would have something like this:

<asp:Content ID="Content1" ContentPlaceHolderID="htmlHead" runat="server">
    <script type="text/javascript" src="js/custom.js"></script>
</asp:Content>

GRIDVIEW - Add View All button to GridView Pager Row

        Protected Sub MyGridView_RowCreated(ByVal sender As Object, ByVal e As GridViewRowEventArgs)
            If e.Row.RowType = DataControlRowType.Pager Then
                Dim space As New LiteralControl(" ")

                Dim lb As New LinkButton()
                lb.ID = "ViewAllLinkButton"
                lb.Text = "View All"
                lb.SkinID = "ProfessionalGridViewPagerViewAll"
                AddHandler lb.Click, AddressOf ViewAllLinkButton_Click

                ' Pager is rendered in a single cell as a table; 
                ' each page # is in a cell by it's own
                Dim table As Table = TryCast(e.Row.Cells(0).Controls(0), Table)

                ' Add ViewAll linkbutton to the last cell
                Dim parentCell As TableCell = table.Rows(0).Cells(table.Rows(0).Cells.Count - 1)
                parentCell.Controls.Add(space)
                parentCell.Controls.Add(lb)
            End If
        End Sub

        Protected Sub ViewAllLinkButton_Click(ByVal sender As Object, ByVal e As EventArgs)
            GridView1.AllowPaging = False
        End Sub