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

Integrating CSS Control Adapter With Menu Control
This is on the request of some of my readers to show how effective Asp.net menu control is by using CSS Control Adapter. Most of the folks either have no idea of what CSS Adapter is or have some problem in integrating that with their applications. So, In this post I will brief you guys how can we use CSS Adapter to format the design of Asp.net Menu Control. Before we start, let me dig out why would somebody use CSS Adapter and what does that do ? Have you ever notice by viewing the source of your ......

Posted On Monday, March 2, 2009 12:37 PM

Prevent Request Timeout in Asp.net
In one of our application we want our user to upload data up to 1GB and the most interesting part is we want this uploading via HTTP. I mean, we have plan to use FTP but that is for future. For now we need to make it with HTTP. Off course, uploading data in GB’s requires much extra time then the default configuration and same problem with the request size. So, to make it done we need to change the configuration of following items. executionTimeOut : Default value is 110 seconds, we need to make it ......

Posted On Thursday, February 19, 2009 8:34 PM

Passing Parameter To User Control On A Modal Popup
This is the most demanded scenario for the one who are using Asp.net AJAX Control Toolkit, I mean I have seen most of the people asking for this feature on asp.net forum. Unfortunately, we have no such functionality provided in Modal Popup because the control get rendered once the page is loaded and the Modal Popup is just a JavaScript which work is just to display a div which is hidden. Here is a little work around for those who wants to pass parameter to user control using Modal Popup. Basically, ......

Posted On Sunday, February 8, 2009 1:35 AM

Disable Control When Asp.net AJAX is in progress
If the AJAX call to the server take too much time, then there is a possibility that user might press some other buttons or some other event occurred which will cause your AJAX call to stop and make a new request. To overcome this situation, I decided to have div on the top of the page so that while AJAX call is in progress user cannot do any thing else. So I simply Drag and Drop a Update Progress Control and write the following stuff. <asp:UpdateProgress ID="UpdateProgress1" runat="server"> ......

Posted On Friday, February 6, 2009 2:08 AM

Send Welcome email to user using Membership API
While using Membership API, It is a very normal task to send user a registration or verification email. We can achieve that using two ways one is using the default email setting of Create User Control and other is by implementing CreateUserWizard.CreatedUser event Method 1: Drag and Drop the create user control, right click then properties and find MailDefination and set appropriate values for each property. BodyFileName is basically the location of the file which contains the body of the email. ......

Posted On Monday, February 2, 2009 6:03 PM

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