Geeks With Blogs

News

Microsoft MVP


DZone MVB


Moderator at CodeASP.NET


Quiz Master







free counters
Free counters
Added on January 19,2012


Follow Me @vmsdurano

A bit About Me



Disclaimer
The opinions expressed herein are my own personal opinions and does not represent the opinions of my employers. Nor does it represent the opinion of my dog, because I don’t have one.


Vinz' Blog (ProudMonkey) "Code, Beer and Music ~ my way of being a programmer" May 2009 Entries
ListBox Control: Save Multiple Selected Items in the Database
This example shows the basics on how to save multiple selected items from the ListBox control to the database. Please note that this example requires a basic knowledge of ADO.NET. STEP 1: Setting up the User Interface (GUI) For the simplicity of this demo, I just set up the web form like below: <html xmlns="http://www.w3.org/19... <head runat="server"> <title>Untitled Page</title> </head> <body> <form id="form1" runat="server"> <div> Employee ......

Posted On Sunday, May 31, 2009 7:11 PM

Why Use DateTime.TryParse?
I decided to write this post because I always encounter some members in the forums.asp.net uses DateTime.Parse method when they try to convert a date string that comes from a TextBox value into a DateTime type (see this forum thread ). Please note that there are certain case why the DateTime.Parse method fails, consider this scenario below: * If the user enters a non valid date formats in the TextBox then the method DateTime.Parse will throw a FormatException because the method cannot recognize the ......

Posted On Wednesday, May 27, 2009 11:28 PM

Download: ASPNET Futures Release
For those who wan't to use the Micorsoft.Web.Preview dll then you need to download the Microsoft ASPNET Futures (July 2007 release) first that contains that dll.. You can download it HERE. Technorati Tags: General ......

Posted On Wednesday, May 27, 2009 5:50 PM

Move ListItems Between Two CheckBoxLists
Recently I encounter question at the forums.asp.net asking if how to move selected ListItems from one CheckBoxList to another. So I decided to post the solution that I have provided in that thread so that others can refer this post if they will encounter the same thing. Here’s the code block below: ASPX: <table> <tr> <td> <asp:CheckBoxList ID="CheckBoxList1" runat="server"> <asp:ListItem>Player1... <asp:ListItem>Player2... <asp:ListItem>Player3... ......

Posted On Monday, May 25, 2009 2:42 PM

FAQ: Capturing Browser Close Event
Some time ago, I always encountered questions in the forums including this thread and this thread on how execute codes when a user closes the browser. AFAIK, the only events that you can use when the browser is closed is the onunload or the onbeforeunload event. The following code blocks below will simulates the closed button of the browser when the user invoked the button and display an alert message informing the user that the window is about to close.. Using the onunload event in the body element:<!DOCTYPE ......

Posted On Wednesday, May 20, 2009 6:24 PM

Pivot Data in GridView - A Generic Pivot Method with DataTable
This example shows how to “PIVOT” the original data that is displayed in the GridView. To start then lets grab two GridViews from the Visual Studio Toolbox and place it to your webform. The ASPX source would look something like this: ORIGINAL Table: <asp:GridView ID="GridView1" runat="server"> </asp:GridView><br /><br /> PIVOTED Table: <asp:GridView ID="GridView2" runat="server" ShowHeader="false"> </asp:GridView> Now, lets create the Generic method for Pivoting ......

Posted On Sunday, May 10, 2009 9:04 PM

Links to Read for Speeding Up your ASP.NET Application
Here are some useful articles that talks about how to improve the performance of ASP.NET Application. I also included here some links that talks about the best practices for speeding up your website. Improving ASP.NET Performance http://msdn.microsoft.com/e... Best Practices for Speeding Up Your Web Site http://developer.yahoo.com/... 10 ASP.NET Performance and Scalability Secrets http://www.codeproject.com/... 10 Tips for Writing ......

Posted On Thursday, May 7, 2009 8:41 PM

Add Spacing/Indention in DropDownList Items
The following code block below will allow you to display spacing or indention in the DropDownList items. protected void Page_Load(object sender, EventArgs e){ if (!Page.IsPostBack) { const string spaceChar = "&nbsp;&nbsp;&n... "; DropDownList1.Items.Add(new ListItem("Parent Item 1", "Parent Item 1")); DropDownList1.Items.Add(new ListItem("Parent Item 2", "Parent Item 2")); DropDownList1.Items.Add(new ListItem(Server.HtmlDecode(... + "Sub1 Item 2"), "Sub1 Item 2")); DropDownList1.Items.Add(new ......

Posted On Thursday, May 7, 2009 6:01 PM

Filter GridView Data based from Date Ranges
This example shows how to filter data in GridView based from two given dates. For example you have two Calendar Control which is allows you to select the Start Date and End Dates accordingly. These selected dates will then be displayed in TextBoxes and later on you wish to Grab the data from the database based from the dates (StartDate and EndDate) that is displayed in the TextBox and bind the result to a GridView control. Here are the code blocks below: private string GetConnectionString(){ //call ......

Posted On Thursday, May 7, 2009 5:11 PM

FAQ: Show Large Image on MouseOver using JavaScript
This example shows how to show a bigger Image when the mouse is hover into the original image. The trick here is we are just getting the path of the original image and set the actual size to a bigger size then display it in another Div. Check the code blocks below for your reference. <html xmlns="http://www.w3.org/19... <head runat="server"> <title>Untitled Page</title> <script type="text/javascript" language="ecmascript"> function ShowBiggerImage(obj) { document.getElementById("La... ......

Posted On Thursday, May 7, 2009 4:49 PM

Save CheckBoxList Selected Items and Retain them on PostBacks.
I decided to write this example because I always encounter this kind of issues at http://forums.asp.net . This demo basically shows how to save the CheckBoxList selected items in the database and retain its selected items on postbacks or when the page is loaded again. To get started then lets start by creating the database for storing the data. STEP 1: Creating the database. Launch Sql Server Management Studion Express and then connect Expand the Databases folder from the Sql Server object explorer ......

Posted On Wednesday, May 6, 2009 9:15 PM

How to: Wrap the data of a Particular Column in GridView
One of the member at the http://forums.asp.net ask if how to wrap the data in the GridView Control. See this thread (http://forums.asp.net/t/14... I decided to post the solution that I was provided in that thread as a reference for all who needs a solution for the same issue. Here’s the code block below: protected void GridView1_RowDataBound(object sender, GridViewRowEventArgs e) { if (e.Row.RowType == DataControlRowType.DataRow) { e.Row.Cells[0].Attributes.A... "word-break:break-all;word-... ......

Posted On Sunday, May 3, 2009 6:10 PM

How to: Disable Previous Dates in Calendar Control
Here an example on how to disable or set the calendar previous dates to not selectable. ASPX: <asp:Calendar ID="Calendar1" TodayDayStyle-Font-Underlin... runat="server" SelectionMode="None" OnDayRender="Calendar1_DayR... > <DayStyle Font-Underline="False" Wrap="False" /> </asp:Calendar> RELEVANT CODE: protected void Calendar1_DayRender(object sender, DayRenderEventArgs e){ if (e.Day.Date < DateTime.Now.Date){ e.Day.IsSelectable = false; e.Cell.ForeColor = System.Drawing.Color.Gray; ......

Posted On Sunday, May 3, 2009 5:51 PM

Changing the Background Color of the Calendar Control based on the Dates from the Database.
I decided to write this example because I always encounter this kind of question at http://forums.asp.net/. This example basically changes the background color of the calendar dates based on the event dates from the database. You can tweak the codes provided in this example to suit your needs. Here are the code blocks below: protected void Calendar1_DayRender(object sender, DayRenderEventArgs e) { DataTable dt = GetDates(); DateTime eventDate; string eventType = string.Empty; if (dt.Rows.Count > ......

Posted On Sunday, May 3, 2009 5:41 PM

Links to Read before Working on Dynamic Controls in ASP.NET
I would like to share with you the following useful articles and FAQ's below about Dynamic Controls in ASP.NET: Dynamically Creating controls in ASP.NET http://support.microsoft.co... http://www.singingeels.com/... Truly Understanding Dynamic Controls http://weblogs.asp.net/infi... Key to ensuring dynamic ASP.NET controls save Viewstate - level 300 http://codebetter.com/blogs... ......

Posted On Sunday, May 3, 2009 3:33 PM

Copyright © Vincent Maverick Durano | Powered by: GeeksWithBlogs.net | Join free