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" August 2009 Entries
Passing Information from .HTM to ASPX page in ASP.NET
Just recently, one of the members at forums.asp.net is asking if how to pass data from .htm page to aspx page. So I decided to share with you of what we have discussed in this thread for a possible solution. Technorati Tags: ASP.NET ......

Posted On Wednesday, August 26, 2009 7:17 PM

How To: Prevent SQL Injection in ASP.NET
Mike Brind has written a very good example about "Preventing SQL Injection in ASP.NET". If you are new to Data Access manipulations in ASP.NET then I would strongly suggest you to read the article mentioned above. Technorati Tags: ADO.NET,ASP.NET,General ......

Posted On Wednesday, August 26, 2009 7:16 PM

Accessing Controls from ASPX to External JavaScript file
This example shows the basic way on how to access control from external javascript file (.js). Normally, we use the following line below when accessing control within our JavaScript method in the page. document.getElementById('&l... TextBox1.ClientID %>'); AFAIK, Using Inline expression like <% %> will not work within external js files. As a workaround we can pass the id of the control (eg. TextBox) to the funciton as a parameter instead like: External JS file: function GetControlValue(obj) ......

Posted On Tuesday, August 18, 2009 10:10 PM

Bind DataTable to DataList Control
This example shows how to bind a DataTable in a DataList control. Just for the simplicity of this demo I’m going to create a dummy data in the DataTable. See the code blocks below: private DataTable GetData() { DataTable dt = new DataTable(); DataRow dr; dt.Columns.Add(new System.Data.DataColumn("Col... typeof(String))); dt.Columns.Add(new System.Data.DataColumn("Col... typeof(String))); dt.Columns.Add(new System.Data.DataColumn("Col... typeof(String))); dr = dt.NewRow(); dr[0] = "Column1 ......

Posted On Thursday, August 13, 2009 10:41 PM

Retain Leading Zeros when Converting from Int to String
Many members in the forums are asking if why is it that an integer value with a leading zero is being trimmed off when converting it to a string? Consider this example: int num = 0123456; // a 7 numbers string sNum = num.ToString(); //The result will give you 123456 What happened to the leading zero? Well basically, leading zero has no significance to an integer because by nature an integer with a value of 01 is simply the same as 1. So based on the example above we have an integer value of 0123456 ......

Posted On Wednesday, August 12, 2009 8:56 PM

UPDATED: Adding Dynamic Rows in ASP.NET GridView Control with TextBoxes and with Delete functionality
In my previous post, I have posted the updated the codes about Adding Dynamic Rows in ASP.Net GridView Control with TextBoxes because there is a bug on that. So obviously the codes in my other example about Adding a Delete functionality in Dynamic TextBoxes in GridView is affected. To fix the issue then you can refer to this updated code below: protected void LinkButton1_Click(object sender, EventArgs e) { LinkButton lb = (LinkButton)sender; GridViewRow gvRow = (GridViewRow) lb.NamingContainer; int ......

Posted On Wednesday, August 12, 2009 5:21 PM

UPDATED: Adding Dynamic Rows in ASP.Net GridView Control with TextBoxes
Well its seems that there is a little bug with my previous article about “ Adding Dynamic Rows in ASP.Net GridView Control with TextBoxes “. The problem is that whenever you change the value of the previous data in the TextBox the updated values will not reflect on postbacks. So I have modified a bit of my codes at AddNewRowToGrid() and SetPreviousData() methods to fix the issue. Here are the code blocks below for the updates: private void AddNewRowToGrid() { int rowIndex = 0; if (ViewState["CurrentTable"] ......

Posted On Wednesday, August 12, 2009 5:08 PM

Removing Columns in DataTable
Recently, one of the members in the forum (http://forums.asp.net) is asking if how to remove a particular column in a DataTable if all values in the row of that column are null or empty. So I decided to post the solution that I have provided in that thread as a reference to others who encounter the same problem. Just for the simplicity of this demo, I created a sample DataTable with a dummy data on it just for us to test. Here’s the code block below: private DataTable CreateDataTable() { DataTable ......

Posted On Tuesday, August 11, 2009 8:32 PM

Hide WebPart Header and Border on BrowseDisplayMode
In order to hide those, we can set the BorderStyle and the PartChromeType attribute of the WebZone to none after we set the display mode of WebPartManager to browse just like below: protected void Page_Load(object sender, EventArgs e) { if (!Page.IsPostBack) { WebPartManager1.DisplayMode = WebPartManager.BrowseDispla... foreach (WebPartZone wz in WebPartManager1.Zones) { wz.BorderStyle = BorderStyle.None; wz.PartChromeType = PartChromeType.None; } } } That’s simple! Technorati Tags: ASP.NET,WebParts,TipsTricks ......

Posted On Tuesday, August 11, 2009 8:31 PM

Adding Dynamic Rows in ASP.NET GridView Control with TextBoxes and with Delete functionality
In my previous examples, I have demonstrated on how to add dynamic rows in GridView control with TextBoxes and how to save the values into the database. Now, seems that most of the developers are asking if how to add a delete functionality with it. So in this example, I’m going to show on how to delete a certain row in the dynamic GridView with TextBoxes. Note: Before reading this example, then be sure to refer my previous examples mentioned above so that you will have a basic idea on how does the ......

Posted On Sunday, August 9, 2009 6:47 PM

Why DataSet creates TableN as the Default Table name?
Few days ago I have encountered a question in asp.net forums asking if why does the DataSet creates a default name as Table1 well in fact the name doesn’t really exist in the database. So I thought I’d share the answer that I have provided in that thread as a reference to others. As the documentation states that: "Multiple Result Sets: If the DataAdapter encounters multiple result sets, it will create multiple tables in the DataSet. The tables will be given an incremental default name of TableN, ......

Posted On Monday, August 3, 2009 5:15 PM

Adding Line Breaks in JavaScript Alert and Confirm popup Message in ASP.NET
Ok it seems that lot’s of members at the forums is asking on how to display multi-line text in a JavaScript pop up box. So I decided to write this example so that other developers can reference it or if I encounter such a post in the forum then I can simply point them in this example. Check the following code blocks below: <html xmlns="http://www.w3.org/19... <head runat="server"> <title>Untitled Page</title> <script type="text/javascript" language="javascript"> ......

Posted On Monday, August 3, 2009 4:45 PM

Validate Image extensions upon Upload
In my previous two examples, we have learned on how to Upload and Save the Image to a Folder and path to database and how to Save the Image to the Database. The two previous examples only tackle the basics about uploading and saving a file without validating the file to be uploaded. In this example, I’m going to show on how to validate a file that only allows image files to be uploaded using server side validations. Here are the code blocks below: private void StartUpLoad() { if (FileUpload1.HasFile) ......

Posted On Monday, August 3, 2009 3:21 PM

Uploading and Storing Image Path to Database and Image to Folder - Part 2 (Displaying of Images)
In my previous example, we have learned on how to save the actual image to a folder and image path to the database. In this example, I’m going to show on how to display those images in a GridView and Repeater control. To get started, let’s create a method for fetching the image information from the database. Here’s the code block below: private DataTable GetData() { DataTable dt = new DataTable(); SqlConnection connection = new SqlConnection(GetConnection... try { connection.Open(); string ......

Posted On Sunday, August 2, 2009 5:55 PM

Uploading and Storing Image Path to Database and Image to Folder - Part 1
I decided to write this example because this has been asked many times at the forums. In my previous article I have shown on how to Upload and Save the Images to Database, In this article I will show on how to upload and save the image to folder and path to database. To get started, let’s create a simple database table for storing the Image information and path to the database. I this example I named the table as “ImageInfo” with the following fields below: Note:I set the Id to auto increment so ......

Posted On Sunday, August 2, 2009 4:58 PM

Save Dynamic TextBox Values from GridView to Database
In my previous article, I have demonstrated on how to add dynamic rows in GridView control with TextBoxes. Now, seems that most of the developers are asking if how to save all the data that was entered from the dynamic textbox in the GridView to the database. So in this example, I’m going to show on how to save them all in the database. To get started then lets create a sample Table in SQL Server. In this example, I named the table as “SampleTable” with the following fields below: Note: I set the ......

Posted On Sunday, August 2, 2009 1:54 PM

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