Wednesday, February 3, 2010

Finding Controls

10:17 AM Posted by Unknown No comments
Check the name of the control in the rendered html. For eg.
I need to find gridview "grdwSelectedCandidates" in usercontrol "SelectedCandidates.ascx" which is inside the ajax tabpanel inside ajax tabcontainer.
I need to find this from another control which is placed in another tabpanel in the same container.
The rendered name is "ctl00_ContentPlaceHolder1_TabContainer1_TabPanel6_SelectedCandidates1_grdwSelectedCandidates"
So, I have to first find content place holder, then, tabcontainer, then, tabpanel, then, control and then gridview.

Wednesday, January 27, 2010

For using excel file as database

6:11 AM Posted by Unknown , No comments
For reading Excel files and getting the data
string FilePath = Server.MapPath("exmaple.xls");

DataSet myDataset = new DataSet();
string strConn = @"Provider=Microsoft.Jet.OLEDB.4.0;Data Source=" + FilePath + @";Extended Properties=""Excel 8.0;HDR=Yes;IMEX=1""";
OleDbConnection conn = new OleDbConnection(strConn);
conn.Open();
DataTable DTable = conn.GetOleDbSchemaTable(OleDbSchemaGuid.Tables, null);
//here the code will read sheet from spreadsheet with any name --generic
OleDbDataAdapter myData = new OleDbDataAdapter
(@"SELECT * FROM [" +
DTable.Rows[0]["TABLE_NAME"].ToString() + "]", conn);
//
myData.Fill(myDataset);

Tuesday, January 26, 2010

Firebug Extensions

9:45 PM Posted by Unknown , No comments
Firebug is the most usefult addon tool for web development. It can help us to find the issues in css, ajax requests etc and many features. There are some other addons which can help to improve the utility of firebug.
Learn More

Monday, January 25, 2010

Saturday, January 23, 2010

Ajax and UpdatePanel performance improvement

7:38 PM Posted by Unknown , , , , No comments
Most of the newbie programmers like me are ajaxifying a site by putting updatepanels all over the site. Now, I came to know that, putting updatepanel will not help you to improve your site's speed. We are using it, since it is very easy. You can understand why ajax updatenpanels should be avoided from the following link

Why UpdatePanel Dangerous



If you still want to use updatepanel, check the following link to speed up the updatepanel performance.

Speeding up UpdatePanel



Also, you can use a dll, scriptreferenceprofiler, to find the ajax scripts used in a page and combine them, so that, only that script requests will be used in that specific page, which reduces the loading time. You can understand how to use it from the following msdn video.

Script Combining

You can download ScriptReferenceProfile from the following url
Download

Use them as follows

Add reference to the dll.
<%@ Register Assembly="ScriptReferenceProfiler" Namespace="ScriptReferenceProfiler" TagPrefix="cc1" %>

Top Money giving Paid To Click site

9:49 AM Posted by Unknown No comments
Its an off topic. I just came to know about this site. They are giving the maximum for click. 50 cents for just clicking banners and 1 USD for reading their emails. Also, referral bonus is there.

payingptr.com