Posts

Showing posts from April, 2012

How to do asp.net,C# custom paging like google using stored procedures with source code

This will give you some hints that How to do custom paging like google using stored procedures in  asp.net and sql server 2008. Its pretty simple but logical as well.  So i am placing my code which is simple to understand and you can modify it accordingly. Stored Procedure: Create PROCEDURE [dbo].[yourProcedurename]                            @StartingIndex int, @PageSize int AS                                              BEGIN   with Slice as   (         select row_number() over(order by id desc) as displayRowNum,*            from table_Name ) select * from Slice where displayRowNum between @StartingIndex and @StartingIndex+@PageSize; END   C# Code: Set your current page to paging bar...   private int SetCurrentPageNumber()     {         int PageNum = 0;         if (Request.QueryString["Page"] != null && Request.QueryString["Page"] != "" && Request.QueryString["Page"] != "0&quo

Themeforest Questions and Answers Solved!

Themeforest Solved questions... I spent some time to complete the   Themeforest.net   author quiz, most of the time i was failed. :O) here are the soleved questions. They are working until my last check on 02-04-2012. Good Luck If you’d like to use an asset within your file that someone else created and you’re unsure whether you’re allowed to, what should you do? – Ask a lawyer or the asset’s license holder Who decides how files are priced? – The ThemeForest staff Who is responsible for copyright violations in submitted files? – The author What will happen if your submission does not validate (excluding browser-specific CSS)? – It will be rejected Who is responsible for testing files to make sure there are no errors? – The author Who is responsible for copyright violations in submitted files? – The author Which of the following would be an appropriate file title? – CoPilot – WordPress and Tumblog Theme OR 20 Tiled Wood Textures What should you do if another author has c

how to Download, Upload, Delete files in FTP and local drive using C#

using System.Net; call this in your .cs file. File Download From FTP: string localPath = @"G:\FTPTrialLocalPath\"; string fileName = "arahimkhan.txt"; FtpWebRequest requestFileDownload = (FtpWebRequest)WebRequest.Create("ftp://localhost/Source/" + fileName); requestFileDownload.Credentials = new NetworkCredential("khanrahim", "arkhan22"); requestFileDownload.Method = WebRequestMethods.Ftp.DownloadFile; FtpWebResponse responseFileDownload = (FtpWebResponse)requestFileDownload.GetResponse(); Stream responseStream = responseFileDownload.GetResponseStream(); FileStream writeStream = new FileStream(localPath + fileName, FileMode.Create); int Length = 2048; Byte[] buffer = new Byte[Length]; int bytesRead = responseStream.Read(buffer, 0, Length); while (bytesRead > 0) { writeStream.Write(buffer, 0, bytesRead); bytesRead = responseStream.Read(buffer, 0, Length); } responseStream.Close(); writeStrea

How to set 100% height of HTML iFrame in all browsers

after searching over the google and spending some time me and my friend ali got this code working for us. I want to set the height of an iFrame 100% in all major browsers like IE,Mozzila,Chrome,Safari and Opera.  It can be done with the support of javascript. Here goes the code. HTML iFrame Code: <iframe align="center" id="iframe_id" name="iframe_id" src="http://www.paksmile.com/" scrolling="yes" width="100%" height="200px" frameborder="0" style="position:relative; bottom:0; left:0; top:0px;" onload="resize_iframe()"> The JavaScript Code: <script language="JavaScript"> window.onresize = resize_iframe; function resize_iframe() {   var viewportwidth;   var viewportheight;   var header = document.getElementById("iframe_id").offsetTop;   // the more standards compliant browsers (mozilla/netscape/opera) use window.i