Justin Cooney

Web Development Tips and Examples

  • JQuery Form Dialog with GridView
    JQuery Form Dialog with GridView

    Hooking up a JQuery Form Dialog Widget to an ASP.NET GridView Control

    Let’s face it: the stock ASP.NET GridView control has some behaviors and limitations that aren’t exactly optimal. For starters, the lack of a nice way for users to add new rows to the grid is unfortunate. There are, of course, several different work-arounds for this all of which have their pros and cons.

    I have been testing out using the JQuery Modal Form dialog widget as an input mechanism for new GridView rows. This has the benefit of not requiring the use of ASP.NET’s heavyweight ViewState and constant back and forth communication with the Web Server. Also, the modal nature of the widget on the Web form is a benefit.

    The obvious drawback of using client side code is that the newly added rows are not stored in ViewState and you will need to handle them yourself. This really isn’t a big deal if you consider using Ajax calls to a Web Service rather than a complete form submission.

    (more…)

  • There are times when it comes in handy to be able to query all columns of all of the tables in a database for a particular text match. For example: if you have just taken over a project with a large database and are trying to find where values from the UI are coming from, then it helps to be able to match text from the UI with tables and columns.

    So you can see how being able to use a T-SQL query to locate the table and column responsible for holding specific data saves a lot of time. Rather than searching through the database diagram and guessing at tables and columns, you can simply run a blanket search to find out where the columns you need are.

    In this article I’m providing a fully working example of a query that will search your database for any specific text that you may be interested in. I have added two restrictions to the example since it can take a longer time to run depending on the size of your database and the frequency that your keyword appears in:

    1. The first restriction is that I limit the search field to only VARCHAR columns.
    2. The second restriction is that the query will only return ten results per column searched.

    (more…)

  • The WordPress.com stats helper monkeys prepared a 2012 annual report for this blog.

    Here’s an excerpt:

    4,329 films were submitted to the 2012 Cannes Film Festival. This blog had 46,000 views in 2012. If each view were a film, this blog would power 11 Film Festivals

    Click here to see the complete report.