Sunday, January 25, 2015

دل ہی تو ہے، نہ سنگ خشت، درد سے بھر نہ آئے کیوں

دل ہی تو ہے، نہ سنگ خشت، درد سے بھر نہ آئے کیوں
روئیں گے ہم ہزار بار، کوئی ہمیں ستائے کیوں

دیر نہیں حرم نہیں، در نہیں آستاں نہیں
بیٹھے ہیں رہگزر پہ ہم غیر ہمیں اٹھائے کیوں

جب وہ جمال دل فروز صورت مہر نیم روز
آپ ہی ہو نظارہ سوز پردے میں منہ چھپائے کیوں

دشنہ غمزہ جاں ستاں ناوک ناز بے پناہ
تیرا ہی عکس رخ سہی سامنے تیرے آئے کیوں

قید حیات و بند غم اصل میں دونوں ایک ہیں
موت سے پہلے آدمی غم سے نجات پائے کیوں

حسن اور اس پہ حسنِ ظن، رہ گئی بوالہوس کی شرم
اپنے پہ اعتماد ہے غیر کو آزمائے کیوں

واں وہ غرور عزو ناز، یاں یہ حجاب پاس وضع
راہ میں ہم ملیں کہاں، بزم میں وہ بلائے کیوں

ہاں وہ نہیں خدا پرست، جاﺅ وہ بے وفا سہی
جس کو ہو دین و دل عزیز اس کی گلی میں جائے کیوں

غالب خستہ کے بغیر کون سے کام بند ہیں
روئیے زار زار کیا، کیجئے ہائے ہائے کیوں

کون روتا ہے کسی اور کی خاطر اے دوست

کبھی خود پہ کبھی حالات پہ رونا آیا
بات نکلی تو ہر اک بات پہ رونا آیا

ہم تو سمجھتے تھےکہ ہم بھول گے ہیں ان کو
کیا ہوا یہ آج کس بات پہ رونا آیا

کس لیے جیتے ہیں ہم کس کے لیے جیتے ہیں
بارہا ایسے سولات پہ رونا آیا

کون روتا ہے کسی اور کی خاطر اے دوست
سب کو اپنی ہی کسی بات پہ رونا آیا

ساحر لدهیانوی

Saturday, January 24, 2015

Comparing Web Forms And ASP.NET MVC


I first saw Microsoft ASP.NET in action in 2004, when it was tentatively named ASP+. At that time, building a Web application on the Microsoft platform was a matter of assembling a bunch of Active Server Pages (ASP). In a typical ASP page, you find HTML literals interspersed with code blocks. In code blocks, script code (mostly VBScript) is used to incorporate data generated by COM objects, such as components from the ActiveX Data Objects (ADO) framework. Undoubtedly, the introduction of ASP.NET in the late 1990s was a big step forward, as it represented a smart way to automate the production of HTML displayed in a client's browser. ASP.NET simplified a number of everyday tasks and, more importantly, enabled developers to work at a higher level of abstraction.This allowed them to focus more on the core functions of the Web application rather than on common tasks around Web page design. Based on server controls, ASP.NET allows developers to build real-world Web sites and applications with minimal HTML and JavaScript skills. The whole point of ASP.NET is productivity, achieved through powerful tools integrated in the runtime as well as the provision of development facilities, such as server controls, user controls, postback events, viewstate, forms authentication, and intrinsic objects. The model behind ASP.NET is called Web Forms and it was clearly inspired by the desktop Windows Forms model (in turn deeply inspired by the Visual Basic Rapid Application Development philosophy). So why did Microsoft release "another" ASP.NET framework, called ASP.NET MVC?


Benefits of ASP.NET Web Forms
As noted, ASP.NET Web Forms is stable and mature, and it is supported by heaps of third party controls and tools. One of the keys to the rapid adoption of ASP.NET is certainly the point-and-click metaphor taken from Windows desktop development. With Web Forms, Microsoft basically extended the Visual Basic programming model to the Web. Desktop development, however, is stateful whereas the Web is inherently stateless. So the Web Forms model essentially abstracted a number of features to provide a simulated stateful model for Web developers. As a result, you didn't have to be a Web expert with a lot of HTML and JavaScript knowledge to write effective Web applications. To simulate stateful programming over the Web, ASP.NET Web Forms introduced features such as viewstate, postbacks, and an overall event-driven paradigm.For example, the developer can, say, double-click on a button to automatically generate a stub of code that will handle the user's clicking to the server. To get started writing an ASP.NET Web application, you just need to know the basics of .NET development, the programming interface of some components, like server controls. Server controls that generate HTML programmatically, and the runtime pipeline, contribute significantly to a fast development cycle. At the end of the day, key features of ASP.NET Web Forms are just the componentization of some ASP best practices. For example, postback, auto-population of input fields, authentication and authorization before page rendering, server controls, and compilation of the page, are not features devised and created from scratch for ASP.NET Web Forms. All of them evolved from ASP best practices. Ten years ago, ASP developers (including myself) were looking for exactly the set of features that ASP.NET Web Forms ended up providing. Furthermore, ASP.NET Web Forms generally exceeded our expectations by providing a full abstraction layer atop the whole Web stack: JavaScript, CSS, HTML. To write an ASP page, you did need to know quite a bit about the Web and script languages. To write an ASP.NET page, in contrast, you need to know primarily about .NET and its compiled languages. Productivity and rapid development of data-driven, line-of-business applications have been the selling points of ASP.NET Web Forms. Until now, that is.


Drawbacks of ASP.NET MVC
ASP.NET MVC brings to the table a clean design with a neat separation of concerns, a leaner run-time stack, full control over HTML, an unparalleled level of extensibility, and a working environment that enables, not penalizes, test-driven development (TDD). Is ASP.NET MVC, therefore, a paradise for Web developers? Just like with Web Forms, what some perceive as a clear strength of ASP.NET MVC, others may see as a weakness. For example, full control over HTML, JavaScript, and CSS, ASP.NET MVC means that you enter the Web elements manually. Much of this pain can be mitigated, however, with some of the more recent JavaScript libraries and even different view engine. In general, though, there's no sort of component model to help you with the generation of HTML, as there is in the Web Forms approach. Currently, HTML helpers and user controls are the only tools you can leverage to write HTML more quickly. As a result, , some ASP.NET developers may see ASP.NET MVC as taking a step backward in terms of usability and productivity. Another point to be made, regarding the impact of ASP.NET MVC on everyday development, is that it requires some upfront familiarity with the MVC pattern. You need to know how controllers and views work together in the ASP.NET implementation. In other words, ASP.NET MVC is not something you can easily learn by experimenting. In my experience, this may be the source of decreased productivity for the average Web Forms developer.

Tuesday, January 20, 2015

Basic Tips for Software Development Managers

Basic Tips for Software Development Managers

1. Look out for pitfalls in project requirements
2. Build the right team
3. Facilitate communication between developers

All software projects are different and each new task might bring unexpected challenges for the team in the middle of a development phase. However, by following some basic concepts mentioned above, project managers can minimize potential risks before even starting development. Having built a good foundation, you can make sure you have enough time and resources to finish every project well and on time.

Sunday, January 18, 2015

کہتے ہیں غالب کا ہے اندازِ بیان اور

ہیں اور بھی دنیا میں سخن ور بہت اچھے
 کہتے ہیں غالب کا ہے اندازِ بیان اور

Saturday, January 17, 2015

ہم کو معلوم ہے جنت کی حقیقت لیکن

حسنِ مہ گرچہ بہ ہنگامِ کمال اچھا ہے
اس سے میرا مہِ خورشید جمال اچھا ہے

بوسہ دیتے نہیں اور دل پہ ہے ہر لحظہ نگاہ
جی میں کہتے ہیں کہ مفت آئے تو مال اچھا ہے

اور بازار سے لے آئے اگر ٹوٹ گیا
ساغرِ جم سے مرا جامِ سفال اچھا ہے

بے طلب دیں تو مزہ اس میں سوا ملتا ہے
وہ گدا جس کو نہ ہو خوئے سوال اچھا ہے

ان کے دیکھے سے جو آ جاتی ہے منہ پر رونق
وہ سمجھتے ہیں کہ بیمار کا حال اچھا ہے

دیکھیے پاتے ہیں عشاق بتوں سے کیا فیض
اک برہمن نے کہا ہے کہ یہ سال اچھا ہے

ہم سخن تیشے نے فرہاد کو شیریں سے کیا
جس طرح کا کہ کسی میں ہو کمال اچھا ہے

قطرہ دریا میں جو مل جائے تو دریا ہو جائے
کام اچھا ہے وہ جس کا کہ مآل اچھا ہے

خضر سلطاں کو رکھے خالقِ اکبر سر سبز
شاہ کے باغ میں یہ تازہ نہال اچھا ہے

ہم کو معلوم ہے جنت کی حقیقت لیکن
دل کے خوش رکھنے کو غالبؔ یہ خیال اچھا ہے

Sunday, January 11, 2015

jQuery Image effect on Mouseover with Opacity light and dark

Introduction:

Here I will explain how to use jQuery to change image opacity on mouseover using jQuery or change opacity of image on hover using jQuery.

Here is the aspx code with the jQuery function.

<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<title>jQuery Change Image Opacity on Mouse Over</title>
<script type="text/javascript" src="http://code.jquery.com/jquery-1.8.2.js"></script>
<script type="text/javascript">
$(function() {
$("#logoimage").css("opacity", 0.5);
$("#logoimage").hover(function() {
$(this).animate({ opacity: 1.0 }, 500);
}, function() {
$(this).animate({ opacity: 0.5 }, 500);
});
})
</script>
</head>
<body>
<form id="form1">
<div>
<img id="logoimage"  src="http://3.bp.blogspot.com/-Ss_jAFd_tAw/VI7UW0_x1lI/AAAAAAAAQDw/5Uko0Ic_P0w/s1600/aavv.JPG" />
</div>
</form>
</body>
</html>




jQuery Caps Lock On or Off in JavaScript

 Introduction:

Here I will explain in jQuery how to check caps lock ON or OFF in JavaScript.
Generally to check caps lock on or off in page load it’s not possible we can analyze key code only in key press using jQuery or JavaScript.

Here is the function for check Caps Look is ON or OF

function checkcapslockon(e) {
var charKeyCode = e.keyCode ? e.keyCode : e.which;
var shiftKey = e.shiftKey ? e.shiftKey : ((charKeyCode == 16) ? true : false);
if (((charKeyCode >= 65 && charKeyCode <= 90) && !shiftKey) || ((charKeyCode >= 97 && charKeyCode <= 122) && shiftKey)) {
alert('Caps Loc On');
}
else {
alert('Caps Loc Off');
}
}

How to Remove Row in Table using jQuery


Introduction:
Here I will explain in how to remove row in table using jQuery or jQuery remove current selected row from table or how to delete table row using jQuery.

The below is  jQuery function to remove the Table Row
<script type="text/javascript">
$(function() {
$('input[type="button"]').click(function(e) {
var row = $(this).closest('tr');
row.remove()
})
})
</script>

JavaScript - Division using Math.Ceil function

Introduction

Here I will explain how to number division in JavaScript or jQuery using Math.ceil() method. Math.ceil() method will rounds number upwards to next nearest integer.

Declaration of Math.ceil() method
Generally we will use Math.ceil() method like as shown below

var result = Math.ceil(45 / 4);
alert(result + ", " + div);

The complete Example using the JavaScritp Math.ceil function.

How to Export Data to Excel from Datatable or Gridview in Asp.net using c#,

Introduction:

Here I will explain how to export data to excel from datatable or dataset in asp.net using c# and vb.net or export data to excel from gridview in asp.net using c#

The below code in your aspx page

<html xmlns="http://www.w3.org/1999/xhtml">
<head id="Head1" runat="server">
<title>Export Data to Excel from datatable or gridview in Asp.net</title>
</head>
<body>
<form id="form1" runat="server">
<div>
<asp:GridView ID="gvDetails" AutoGenerateColumns="false" CellPadding="5" runat="server">
<Columns>
<asp:BoundField HeaderText="UserId" DataField="UserId" />
<asp:BoundField HeaderText="UserName" DataField="UserName" />
<asp:BoundField HeaderText="Education" DataField="Education" />
<asp:BoundField HeaderText="Location" DataField="Location" />
</Columns>
<HeaderStyle BackColor="#df5015" Font-Bold="true" ForeColor="White" />
</asp:GridView>
</div>
<asp:Button ID="btnExport" runat="server" Text="Export to Excel from Gridview"
onclick="btnExport_Click" BackColor="#DF5015" ForeColor="White"  />
<asp:Button ID="btnExportTable" runat="server"  BackColor="#DF5015" ForeColor="White"  Text="Export to Excel from Datatable"
onclick="btnExportTable_Click"  />
</form>
</body>
</html>

Import Excel Data to Datatable or Dataset or Gridview in Asp.net C#

Introduction:

Here I will explain how to Import excel data into datatable or dataset in ASP.NET C#, or Import data from excel to gridview in asp.net using OLEDB in C#

The below code in your aspx page
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<title>Read and Display Data From an Excel File (.xsl or .xlsx) in ASP.NET</title>
</head>
<body>
<form id="form1" runat="server">
<div>
<b>Please Select Excel File: </b>
<asp:FileUpload ID="fileuploadExcel" runat="server" />  
<asp:Button ID="btnImport" runat="server" Text="Import Data" OnClick="btnImport_Click" />
<br />
<asp:Label ID="lblMessage" runat="server" Visible="False" Font-Bold="True" ForeColor="#009933"></asp:Label><br />
<asp:GridView ID="grvExcelData" runat="server">
<HeaderStyle BackColor="#df5015" Font-Bold="true" ForeColor="White" />
</asp:GridView>
</div>
</form>
</body>
</html>

How to Get Gridview Footer Controls id in JavaScript

Introduction:

Here I will explain how to access asp.net gridview footer control ids or values in JavaScript or find controls inside gridview in JavaScript or find asp.net gridview footer controls (textbox, dropdownlist, checkbox, radio button etc..) values or ids in JavaScript.

Syntax to Get Gridview Footer Controls in JavaScript

<script type="text/javascript">
function GetGridFooterRowvalues() {
var fuid = document.getElementById('<%=((TextBox)gvUserInfo.FooterRow.FindControl("txtUserId")).ClientID %>');
if (fuid != null && funame != null && fueducation != null) {
alert('UserId:' + fuid.value)
}
}
</script>

Saturday, January 10, 2015

How to Delete Row from Gridview With JavaScript Confirmation in C#, Asp.net

Introduction:

Here I will explain how to delete row from gridview in asp.net using c# , with Java Script confirmation message . when you Click on Delete button it will show you confirmation box to Delete Yes or No.

The below code in your .aspx page

Tuesday, January 06, 2015

How to Count Number of Online Users in Asp.Net Using C#, VB.NET

 I will explain how to count number of online users of website in asp.net using C#

 To get number of online visitors for website we need to use methods in Global.asax file for that first add Global.asax file in your application

Open Visual Studio ->> Create New Website ->>  Right click on Solution Explorer -->> Select Add New Item -->>  Select Global Application Class file and click OK

Now open Global.asax file and write the code like as shown below

Difference between String and Stringbuilder in C#, Asp.net

 I will explain what is difference between string and stringbuilder in c# using asp.net.

String:
String is immutable. Immutable means once we create string object we cannot modify. Any operation like insert, replace or append happened to change string simply it will discard the old value and it will create new instance in memory to hold the new value.

Example:
string str = "AoA";
// create a new string instance instead of changing the old one
str += "Good";
str += " morning";

Copy Selected Gridview Rows to Another Gridview in Asp.net

Here I will explain how to Copy Selected Gridview Rows to Another Gridview in Asp.netusing c#, vb.net

Here is the HTML of the page with 2  Gridview

<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<title>Tranfer selected gridview rows to another gridview in Asp.net</title>
</head>
<body>
<form id="form1" runat="server">
<div>
<asp:GridView ID="gvDetails" AutoGenerateColumns="false" CellPadding="5" runat="server">
<Columns>
<asp:TemplateField>
<ItemTemplate>