Greybox and AJAX.NET Issue

 

I have a GridView that displays a bunch of data.  The data is bound from a RowDataBound databound method.  All is well with this.  I can sort, page etc without an issue. 

 

If you look at the top of the image you will see the Months of a year.  These are LinkButton controls that have a CommandArgument representing the Month number and an OnClick event that calls a Method.  This method get the CommandArgument and "re-binds" the data with the Month ID passed in.  Ex.  By Default the page loads the Month ID of the current month, if you click on Dec then the Month ID is now 12 and all December data is displayed.  

All is well still.  

With this in place you get the standard PostBack operations where the page reloads.  Well I want to make this a little "slicker" so I added the an UpdatePanel to the page.  Great.  All is great.  Here is the page is structured.

<asp:Panel ID="PanelLinks" runat="server">
            <asp:UpdatePanel ID="PanelLinksForm" runat="server">
                <ContentTemplate>
                    <h1>Calendar of Events</h1>
                    <p>Check out these great upcoming events!</p>
                    <p>
                    <asp:LinkButton ID="linkJan" runat="server" CommandArgument="1" Text="Jan" onclick="link_Click"></asp:LinkButton>
                    <asp:LinkButton ID="linkFeb" runat="server" CommandArgument="2" Text="Feb" onclick="link_Click"></asp:LinkButton>
                    <asp:LinkButton ID="linkMar" runat="server" CommandArgument="3" Text="Mar" onclick="link_Click"></asp:LinkButton>
                    <asp:LinkButton ID="linkApr" runat="server" CommandArgument="4" Text="Apr" onclick="link_Click"></asp:LinkButton>
                    <asp:LinkButton ID="linkMay" runat="server" CommandArgument="5" Text="May" onclick="link_Click"></asp:LinkButton>
                    <asp:LinkButton ID="linkJune" runat="server" CommandArgument="6" Text="Jun" onclick="link_Click"></asp:LinkButton>
                    <asp:LinkButton ID="linkJuly" runat="server" CommandArgument="7" Text="Jul" onclick="link_Click"></asp:LinkButton>
                    <asp:LinkButton ID="linkAug" runat="server" CommandArgument="8" Text="Aug" onclick="link_Click"></asp:LinkButton>
                    <asp:LinkButton ID="linkSept" runat="server" CommandArgument="9" Text="Sep" onclick="link_Click"></asp:LinkButton>
                    <asp:LinkButton ID="linkOct" runat="server" CommandArgument="10" Text="Oct" onclick="link_Click"></asp:LinkButton>
                    <asp:LinkButton ID="linkNov" runat="server" CommandArgument="11" Text="Nov" onclick="link_Click"></asp:LinkButton>
                    <asp:LinkButton ID="linkDec" runat="server" CommandArgument="12" Text="Dec" onclick="link_Click"></asp:LinkButton>
                    </p>
                    <div style="height:320px; width:568px; overflow:auto;">
                        <asp:GridView ID="GridView1" runat="server" DataSourceID="SqlDataSource1"
                            AutoGenerateColumns="false"
                            AllowSorting="true"
                            AllowPaging="true"
                            PageSize="5"
                            OnRowDataBound="GridView1_RowDataBound"
                            OnPageIndexChanging="GridView1_PageIndexChanging"
                            Width="550">
                            <HeaderStyle CssClass="event-header" />
                            <RowStyle CssClass="event-item" />
                            <EmptyDataRowStyle CssClass="event-empty" />
                            <Columns>
                                <asp:TemplateField SortExpression="CreateDate" HeaderText="Date" ItemStyle-Width="70">
                                    <ItemTemplate>
                                        <asp:Literal ID="litDate" runat="server"></asp:Literal><br />
                                        <asp:Literal ID="litTime" runat="server"></asp:Literal>
                                    </ItemTemplate>
                                </asp:TemplateField>
                                <asp:TemplateField HeaderText="Concert Name" ItemStyle-Width="100">
                                    <ItemTemplate>
                                        <asp:HyperLink ID="imgVenue" runat="server" NavigateUrl="javascript:void(0);" rel="gb_page_center[620,315]" /><br />
                                        <asp:Literal ID="litName" runat="server"></asp:Literal>
                                    </ItemTemplate>
                                </asp:TemplateField>
                                <asp:TemplateField HeaderText="Artists" ItemStyle-Width="150">
                                    <ItemTemplate>
                                        <asp:Literal ID="litArtists" runat="server"></asp:Literal>
                                    </ItemTemplate>
                                </asp:TemplateField>
                                <asp:TemplateField HeaderText="Venue" ItemStyle-Width="110">
                                    <ItemTemplate>
                                        <asp:Literal ID="litVenue" runat="server"></asp:Literal>
                                    </ItemTemplate>
                                </asp:TemplateField>
                                <asp:TemplateField HeaderText="Artists" ItemStyle-Width="120">
                                    <ItemTemplate>
                                        <asp:HyperLink ID="linkTickets" runat="server" Text="Get Tickets Now" Target="_blank"></asp:HyperLink>
                                    </ItemTemplate>
                                </asp:TemplateField>                           
                            </Columns>
                            <EmptyDataTemplate>
                                There are no events for the month selected
                            </EmptyDataTemplate>
                            <PagerSettings Mode="NextPreviousFirstLast" PageButtonCount="5" Position="Bottom" Visible="true" />
                        </asp:GridView>
                    </div>
                </ContentTemplate>
            </asp:UpdatePanel>
        </asp:Panel>
    </div>
</div>
<asp:SqlDataSource ID="SqlDataSource1" runat="server"
    ConnectionString="<%$ ConnectionStrings:RockTheSoundDataConnectionString %>"
    SelectCommand="usp_EventTour_GetCalendarEvents" SelectCommandType="StoredProcedure">
    <SelectParameters>
        <asp:Parameter Name="Month" Type="Int32" />
    </SelectParameters>
</asp:SqlDataSource>

And in the master page I have the ScriptManager.

Great!  Everything works. 

So I want to get even more fancy so I incorporated a GreyBox.  For those not familar with GreyBox please check it out. You can see the GreyBox code in the TemplateField of the Concert Name.  Again, great.  When you come to the page, it loads the default data and if you click on the image it loads in the GreyBox.  Perfect!

Then something happens.  When you click on a Month it performs the new data bind for that month data and then click on the image to open the GreyBox again, kapow!  It stops working.  It now becomes just a straight link and goes to that page instead of loading the page in the GreyBox.  No clue why.  Tried to debug but running into no answer.

Anyone?

 

 

 

 

 

Be the first to rate this post

  • Currently 0/5 Stars.
  • 1
  • 2
  • 3
  • 4
  • 5

Useless Tool

I am a fan of useless tools.  Not sure why.  I guess because it is simple pleasure for a few minutes.  My wife hates that kind of stuff..but when you have 5 minutes to kill why not kill it on something dumb.  Well here is one. 

Did you ever wonder what it would be like to wear a turban? No...why not?  Well here is your chance.

 


 

Be the first to rate this post

  • Currently 0/5 Stars.
  • 1
  • 2
  • 3
  • 4
  • 5

Adding a DataRow from another DataTable to a New DataTable

I have a .NET DataTable with a bunch of rows.  I don't / can't change the stored procedure to return only the results I want.  I decided to look through the DataTable and take only the rows I want.  When I did a DataRow.Add(DataRow) it did not like that.  I had to do a DataTable.Import(DataRow).

Here is my code

 

DataSet ds = GetDataSet();
           

DataTable newDt = new DataTable();
           

newDt = ds.Tables[0].Clone();


foreach (DataRow dr in fullDs.Tables[0].Rows)
{
  if (dr["my_column"].ToString() != "my-value")
  {
    newDt.ImportRow(dr);
  }
}

Be the first to rate this post

  • Currently 0/5 Stars.
  • 1
  • 2
  • 3
  • 4
  • 5

Sales Guy vs Web Guy

If your in the IT / Web world then you would appreciate this video.  If not, then just ignore.

 

 

Be the first to rate this post

  • Currently 0/5 Stars.
  • 1
  • 2
  • 3
  • 4
  • 5

Another google Android Video

I was extremely pumped up when Google released the OS for Android.  I downloaded the emulator, the sdk and all the doc's to get going.  I was going to develop the next app.  Well, laziness kicked in and so did the real world of actually working.  Another video was release with the potential of this phone OS and my blood is boiling again.  Maybe this time.

 

 
In case you never saw the first video
 

 

Be the first to rate this post

  • Currently 0/5 Stars.
  • 1
  • 2
  • 3
  • 4
  • 5

Agile vs Unified

A question was presented to me the other day with regards to project methodology. The question was do you think a project would be more successful using a Unified Process or an Agile Process? Before I go into my answer I guess I should explain a little bit about the two.

What is a process methodology? Well in our world of software engineering there are ways to go about defining and building a project. A blueprint, so to speak. To compare it to building a house, you would first interview the resident, do some site surveys, find out from the town regarding constraints, come up with some ideas and then start your plans. Get the contractors scheduled and start the build and once complete you get the inspector to come back and make sure all is when and then hand the keys to the lucky homeowner. The same is true in software. There is a method to the madness and we call it a process.

We can debate widely about all of the types of processes, waterfall, scrum, xp, fdd, rad etc., but for this discussion I will only talk about Agile and Unified at a high level, not the variation of them.

At work we have a "unified process". It has the standard phases of the unified process, inception, elaboration, construction and transition. We tacked on 2 more, a strategy up front and an optimization to the end. (Actually the names have changed to be more hip but I really do not know what they are...so much for process). In any case, a typical project follows these steps outlined above. The timeframe can be anywhere from 6-8 weeks to 16-24 weeks. So when a client says I want a new website or X competes with my competition it will take a few months to get that out to market. In the whole scheme of things that is quick. The Web world waits for no one.
In the unified process each of these steps tells us the input and output that we should have before we go to the next step. Let’s get an idea and then start dissecting it. Let’s define scope and requirements and how the whole thing will be put together. Let’s start building it and get ready to test it and….what….you want to add something…or change something…or…we need to revisit requirements and start that phase over again. In most cases that is not the norm but in some, it very well can be.
The issue I have been seeing with some of these projects is the idea changes and morphs over time. With changes comes increased scope and increased timelines and increased deliverables but an end date that cannot be moved. I have also seen projects where we defined the project perfectly and delivered on time and on budget but the “craze” were over by the time it hit the market. So how do we fix that?

Before I can offer my suggestions on a fix to this, how about we take a look at Agile? Agile is used in many software development circles. The main difference is the iteration portions of the Agile method vs. the Unified process full lifecycle. Agile relies on face to face communication over documentation and rapid changes to the project. It also requires a strong team to keep the scope in “scope” and to make sure the iterations do not get out of control. The time to market for an application is really quick and being that it is not a full release changes to this app can be made rather “Agile”.
So, what was my answer? I played the political part. I said I think the unified process can work for larger projects and Agile can work for all. Unified may hinder the rapid development on smaller ones where Agile and speed it up. I did however say with Agile you need a solid team to understand budget and scope where a Unified gets away with it by relying on documentation.
Agile is the approach I would take if I had to choose.




Be the first to rate this post

  • Currently 0/5 Stars.
  • 1
  • 2
  • 3
  • 4
  • 5

Semantic Web Is Here!

I have been a big fan of the Semantic Web, I think it is cool when computers try to become smart like humans and provide reasoning to commands. Computers by default are just dumb. They are only as smart as they are programmed. Inhertently they just know yes or no. On or off. They only know "instructions" or commands and can execute on them. Inflections or abiguity is not for a computer.

How can that be overcomed? Well, in the past there have been some companies that have tried but have been somewhat limited. Remember those IM bots that would spit back sports information.

True Knowlegde has taken sematics one step further. Still in beta they have released some info on how it works and how it will display what you are looking for plus any relative info surrounding it.

 

 

 

Check more out here.

Also, here is a social network built on semantics also

Be the first to rate this post

  • Currently 0/5 Stars.
  • 1
  • 2
  • 3
  • 4
  • 5