studio NETSOULS

Applying Web To Your Business

DateTime Operations

DateTime is a very important datatype and data in terms of realtime application. Some of the application that run timely manner and some of the application that generate data (log file) with time.
To generate such report you need to required store information about date and time.

In .NET there is datatype called DateTime. This contain all information about datetime but sometime problem with this too.More...


Need to crop or resize images before uploading, in asp.net? Sounds like the alternative to thumbnail generation in asp.net web page? Here comes a handy code using jQuery, JCrop and ASP.NET.

I have coded a shopping cart in which there was the need of uploading images to the server, and keep the sizes as required by the content of the pages. In my case I had to hard-code the size of the thumbnail I generated. But wouldn't it be lovely if the site user could crop the image and fix the required size? So I have found one very useful way to Upload and Crop Images with jQuery, JCrop and ASP.NET. I hope this will be useful for all programmers.

Upload and Crop Images with jQuery, JCrop and ASP.NET


RadCompression for ViewState

I'll show you how you can quickly enable ViewState compression and show you the effects it has on overall ViewState size and server performance.

How do I enable Viewstate compression?

Enabling ViewState compression with the RadCompression module really couldn't be easier. It requires no changes to your code, no changes to your markup, and not even a change to your web.config (assuming you've already added the required HttpModule references). The only thing you need to do is add a new Browser file to your web project (or modify your Browser file if you're already using one). To add a new Browser file, follow these simple steps: More...


Sometimes, in pure html website, you may require to send email of the form contents to one ore more people. You can use the following code to first validate the form data entry and then send the contents of the form.More...


A lot of time you need to show larger images of thumbnails in a pop-up window in a website. The pop-up window which opens up can be easily re-sized as per the image dimensions, so that the window doesn’t render any vertical or horizontal scrollbars. More...


Add New Link Row in GridView

This example is useful when you need to add new row in the gridview. Here  to can add the link URL runtime.

Add a placeholder in the HTML page. More...


Transpose DataTable Contents

This code is useful to transpose the datatable rows and columns.

DataTable dtSource = new DataTable();   
protected void Page_Load(object sender, EventArgs e)   
{   
    // Bind the source datatable from the database   
    dtSource = dataSource();   
}   

public DataTable FlipDataTable(GridView gvNew)   
{  
    DataTable dataTable = new DataTable("dataTable");  
    
    // create column  
    DataRow newRow;  
    for (int iRow = 0; iRow < dtSource.Columns.Count; iRow++)  
    {  
        newRow = dataTable.NewRow();  
        
        newRow[0] = dtSource.Columns[iRow].ToString();  
        for (int iCol = 1; iCol <= dtSource.Rows.Count; iCol++)  
        {  
            newRow[iCol] = dtSource.Rows[iCol - 1][iRow];  
        }  
        dataTable.Rows.Add(newRow);  
    }  
}

Lets suppose you have a data source in XML like:

<Settings>
    <ElementCollection>    
        <add key="SomeKey" value="SomeValue">
        <add key="SomeKey" value="SomeValue">
    </ElementCollection>
</Settings>

Now you want to edit the key and values with in the xml element collection.

<asp:XmlDataSource ID="configXmlDataSource" XPath="//add" 
    runat="server" DataFile="~/settings.config"/> 

Use the following code in the code-behind

// In this code we are getting the Data Item values 
// of the Rad Editor. On UpdateCommand Event we are getting 
// the values of data row in an instance of hash.   
GridDataItem dataItem = (GridDataItem)e.Item;    
Hashtable ht = new Hashtable();    
dataItem.ExtractValues(ht);   

// Get the node values as per the selected key name:    
XmlNode AppNode = XmlDataSource1.GetXmlDocument().SelectSingleNode
    ( String.Format("//add[@key='{0}']", key));

// Now assign the new value of the Value attribute of the 
// selected node:  
AppNode.Attributes["value"].Value = ht["value"];  

//Finally we need to update the xml source file:  
configXmlDataSource.Save();

Merge Two DataTable Columns

Lets you have two datatables having two same columns. This code is useful to merge the columns. More...


When a table's primary field is to auto increment with a seed and you are deleting the records from the table. Now you need to reset the primary field value to 1. The code given below is useful.

DBCC CHECKIDENT (tblName, RESEED, 0)

Recent Project Snapshots

  • Mary Kay - Make Over Contest
  • Utility Forms
  • Oncomed
  • Nutrition Vista
  • Forysth Barr - Letter Writer Application
  • Phase One Trials - Content Management System

About Us

studio NETSOULS is a complete IT services company, offering strategy, design, development and implementation of the total solution for your web and IT initiatives. The solutions we provide, enables businesses to leverage leading edge technology to gain sustainable competitive advantages in today's marketplace.

We specialize in designing, developing and deploying the next generation of IT solutions including e-business solutions Read more...

Month List