Geeks With Blogs

News

Agha Usman Ahmed JILAWATAN Asp.net
Get Countries Name in .Net
Introduction: In this post, I will explain you how can we get the countries name filled in any collection using .net without using any database. It is a regular task, which we all as developers did some past day but the difference is we used database table or xml file to hold the country names. But .net framework provide us with all the countries information in Globalization namespace. So, here is the code for that Dictionary<string,string... objDic = new Dictionary<string,string... foreach ......

Posted On Sunday, July 26, 2009 1:43 AM

Show Loading Message in Asp.net AJAX
In this post, I will explain you how can we show Loading message in asp.net ajax without using Update Progress. Now some one may asked, why do I want to skip Update Progress ? Well, there can be several reasons for this, fist of all you have to work on every single page, and on every update panel to get the update progress working. There are basically three methods of meeting this requirement. Using Master Pages : A very smart way, but not all of us are using them .. right ? Extending Page Class ......

Posted On Sunday, July 19, 2009 8:47 PM

Migrate from WordPress to BlogEngine.net
In this post, I will explain how to migrate a blog running on Word Press (Self Hosted) to BlogEngine. But before I start let me say, that Word Press simply rocks. The reason why I plan to switch my blog is customization. Since I am a dotnet geek, I really have no great idea of what I can make out of Word Press using PHP and when it comes to Blogging in .net, I guess I made a very right decision to use BlogEngine. It is open source and included all the necessary blogging utilities. The main thing ......

Posted On Sunday, July 19, 2009 6:37 AM

How to show and select month/year in Calendar Extender
In this post I will explain you, How to make calendar extender control to show month / year view by default and instead of selecting dates how can we use calendar extender to select months. Before I start, let me say that I got extensive support from this forum post http://forums.asp.net/t/134... Thanks to Zhi-Qiang Ni, but the way he follow was a little bit lengthy. However, all credit still goes to him because I gain the exact idea from his post. Let me start by creating a calendar extender ......

Posted On Sunday, May 31, 2009 3:19 AM

Custom Paging in Grid view
So, it takes too long for me to write this post. even though I completed the coding stuff a week back but it is really hard to manage time these days. In this post, I will explain and demonstrate you how to create custom paging in Grid view control. Paging which works like the Google Paging. Let me elaborate more, say for example you have a record set of 500 items and you want to display 10 items per page. Now what happen to the pages numbers. Either you use the default with “..” sign after 10th ......

Posted On Monday, May 18, 2009 9:17 PM

Datatable to JSON
In this post I will explain you, how can we serialize Datatable to JSON. So that, it can easily pass to JavaScript to get the AJAX done. First of all fill a Datatable with some results. DataTable dt = new DataTable(); SqlConnection objSqlCon = new SqlConnection(System.Config... objSqlCon.Open(); SqlDataAdapter objSqlDa = new SqlDataAdapter("select * from Production.Product", objSqlCon); objSqlDa.Fill(dt); Now ......

Posted On Saturday, May 16, 2009 4:52 PM

Authenticated File Access using HTTP Handler.
In this post I will explain you how authenticate the request directly coming to access a file that is downloadable. some thing like *.pdf or *.zip. Mostly, people make it working by creating an *.aspx page and then write binary of that file in Response.WriteFile. So, user will have no idea where the file is coming from. now this is the fair approach but what if somebody, somehow know the path of downloadable files. So, to stop the un authenticated access to our files, we will first create a session ......

Posted On Friday, May 8, 2009 2:20 AM

How to pass parameters to the dynamically added user control
In this post, I will explain how you can pass parameter to the dynamically added (from code behind) User Control. Most of you might aware of how we can achieve this in web application project. Following is the code for that 1: Dim objCon As Control = Page.LoadControl("~/Control... 2: Ctype(objCon,MyControl).Pro... = "Test" 3: Ctype(objCon,MyControl).Pro... = "USAM" 4: MyPanel.Controls.add(objCon) Now what if you have a web site project which does not have the pre-compiled ......

Posted On Wednesday, April 15, 2009 8:36 PM

Get Repeater Control Output in String
In this post I will share with you a small code snippet which will help you to get the repeater control output in string variable. 1: Dim sb As New StringBuilder() 2: Dim objHtml As New HtmlTextWriter(New System.IO.StringWriter(sb)) 3: 4: If dt.Rows.Count > 0 Then 5: Repeater1.DataSource = dt 6: Repeater1.DataBind() 7: End If 8: 9: Repeater1.RenderControl(obj... 10: Return sb.ToString() Well, I have used a little trick here. The RenderControl method of repeater control can put all the HTML in ......

Posted On Monday, April 13, 2009 8:29 PM

Saving and Retrieving File Using FileStream SQL Server 2008
FileStream data type is a very important feature of SQL Server 2008 and gradually getting popular amongst developer for it’s feasibility. And in the past few days specially after “Configure SQL Server 2008 for File Stream” post. I received several feedbacks regarding the usage of FileStream with Ado.net and Frankly there is not much stuff available on Google for this topic. In this post, I will guide you to use FileStream Data type in Ado.net. But before we start make sure you have configure your ......

Posted On Monday, March 16, 2009 1:10 AM

Copyright © Agha Usman Ahmed | Powered by: GeeksWithBlogs.net