Saturday, September 5, 2015

General
1*. Explain about Current project.
2. Technologies used in the current project.
3. Team Size.
4. Percentage of involvement in Leading and Development.
5. Do you have experience in working with global team?
6. Have you involved in documentation?
7. How many modules are there in your project ?
8*. Current Role in your project.
9*. What are the difficulties faced in the current project?
10*. What is Agile methodology, feature ?
11. Time Estimation
12*. Unit Testing 

C#
1*. Why var keyword is used and when it is the only way to get query result?
2. What is the use of IEnumerable interface ?
3. What is LINQ?
4. What are the different type of operators in LINQ ?
5. What is a Lambda expression?
6. What is the use of "throw" keyword?
7. What is the difference between out and ref in C#?
8. What’s the difference between System.String and System.Text.StringBuilder classes?
9. Explain about access modifiers in C#.
10. Hashtable Vs Dictionary<> ? Difference and its uses.
11. What is extension method ?
12. What is difference between overloading and overriding?
13*. What is new C# 3.5 ?. - Automatic properties, Implicit typed variable, Collection Initializer etc.,
14. What is Reflection?
15*. How to assign null value to an integer variable ?
16*. What is attribute ? How to create custom attribute ?
17. What is fluent interface ?
18. What is the main difference between delegate and an event in c#?
19*. What is the use of protected constructor ? Why it is needed ?
20. How to declare local variable with in the interface ?
21. What is the use of IFactory ?
22. What are different type of collection objects available in c# ?
23*. What is use of using keyword ?
24. What is serialization ? What is the use of serialization ?
25. Support for regular expression in C#.
26*. What is Generics ? What is the use of generics ?
27. What is optional parameter in C# ?
28. What is the difference between abstract class and interface ?
29*. Can we call base class method without creating instance?
30. What is early binding and late binding?
31*. What is design pattern ? New few design patterns used in your application.
32. Difference between override and new keyword.
33. What is the use of virtual keyword?

Asp.NET
1. What is the use of Application_Start method ? how it differs from Session_Start method ?
2. What is the use of httphandlers & httpmodules ?
3. How to prevent XSS (Cross side scripting) attack ?
4. Explain the Asp.Net page life cycle.
5*. What is the use of ClientID property?
6. How to add a reference to the namespace in a ASPX/ASCX page ?
7. How to add a custom attribute to an usercontrol ? 
 e.g. <uc:Control ID="MyControl" runat="server" MyValue="10" />
8*. How to handle exceptions & errors ? how to log errors/exceptions for tracing the problem.
9*. How to implement caching in Asp.Net ? What are the types of caching ?
10*. What is the use of binding redirect ?
11. Is there any possibilities to have more than one Web.config? If yes tell me how its possible?

12. Is it possible to have our own custom sections in web.config ?
13. What is Localization and Globalization? How will you implement?
14.  What are the steps you will follow to reducing the page size for increasing the     performance of the page?
15. You need to display the Error.aspx page if an unhandled error occurs on any page within the site. What should you do?
16*. How to register a assembly in to GAC ?
17. What is form authentication and how it works ?
18*. What are the different types of Session state management options available with ASP.NET?

19. What is AXD compression ?
20. What is the use of pre-build and post-build events ? How to register these events in VS2010 ?
21*. What is the difference between postback and callback ?
22. What is concurrency control ? What are the types ?
23. Explain different ways of state maintenance in ASP.NET.
24. How to pass values between pages in Asp.Net ?

25*. How to add a user control in to a page dynamically ?

Javascript
1*. What does isNaN function do?
2. How to create a new HTML element using JavaScript?
3*. How to make Ajax call on the client side ?
4. What looping structures are there in JavaScript?
5. How to replace all occurrence of a particular text in  a string?
     e.g. Hello World -> Replace "l" with "" -> Heo Word
6*. How to restrict a user from entering only numeric values in a textbox ?
7*. How to handle errors in JavaScript ?
8. How to disable/enable a HTML control using JavaScript ?
9*. How to Organize the JavaScript file to avoid name clash?
10. Can you run Asynchronous function using Java Script?
11. What is JSLint?
12. What is an associative array?
13*. What is undefined in JavaScript?
WCF
1*. What is end point ?
2*. How WCF is different from web services ?
3. What are the main attributes of end point ?
4. What are the different type of contracts available in WCF ?
5*. How to consume secured web services using WCF client ?
6. How to log Soap request & response in WCF ?
7. Which are the tools available to capture the service request & response ?
8. how to create mock web services ?
9. Is it possible to move the end points from web. config in  a separate file ? how to do this ?
10*. Explain the steps for consuming a web service using WCF client.

jQuery/JSON
1*. What does dollar Sign ($) means in Jquery?
2*. How is body onload() function is different from document.ready() function used in jQuery?
3. How can you select all elements in a page using jQuery?
4. What is the difference between jQuery-x.x.x.js and jQuery.x.x.x-min.js
5. What are Selectors in jQuery mean ?
6. Why is jQuery better than javascript?
7*. How to get the server response from an AJAX request using Jquery? 
8. How do you update ajax response with id " results" ?
9*. How to attach & deattach the event in jQuery?
10*. What is JSON and why it is needed?
11. How to call asynchronous method using jquery?
12*. Purpose of 'each' in jquery?
13. What is safe timeout in jquery?

SQL
1*. What is the use of SET NOCOUNT ON ?
2. What are the different type of joins in SQL ? Explain in detail.
3. Difference between cross join and Full outer join.
4. What is the difference between UNION and UNION ALL?
5*. What is the difference between a Local and a Global temporary table?
6. What's the difference between DELETE TABLE and TRUNCATE TABLE commands?
7*. What are constraints? Explain different types of constraints.
8. What are the types of indexes?How many clustered indexes can be created on a table?
9. Purpose of @@TRANCOUNT
10. What is sub query ?
11. What is Raiseerror? purpose of @@ERROR?

MVC
1. What is MVC ? What is the need ?
2. What is filtering in ASP.NET MVC?
3. What is the use of Model meta data provider ?
4*. What is the difference between MVC and Asp.Net?
5*. What are the different type of action results ?
6. Purpose and knowledge of unit test & test case? How to write automated test cases ?
7*. What is Html Helper and its use ?
8*. What is difference between ViewData and TempData ?
9. What is  Route table ?
10. What is the use of RedirectToAction method ?
11. What is the use of Data Annotations ?
12*. What is Razor ?
13. What is unobtrusive Ajax ?
14*. What is partial view in Asp.NET MVC ?
Performance
1. How to improve the performance of the application?
2. What is javascript minification?


Friday, May 16, 2014

What is the use of the CommandBuilder class?



The CommandBuilder class is used to automatically update a database according to the changes made in a DataSet.

This class automatically registers itself as an event listener to the RowUpdating event. Whenever data inside a row changes, the object of the CommandBuilder class automatically generates an SQL statement and uses the SelectCommand property to commit the changes made in DataSet.

OLEDB provider in .NET Framework has the OleDbCommandBuiider class; whereas, the SQL provider has the SqlCommandBuilder class.

Wednesday, May 7, 2014

Check uncheck all checkboxes in gridview using jquery

<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
<title>check uncheck all checkboxes in gridview</title>
<script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jquery/1.7.2/jquery.min.js">
</script>
<script type="text/javascript">
$(document).ready(function() {
$('[id$=chkHeader]').click(function() {
$("[id$='chkChild']").attr('checked', this.checked);
});
});
</script>
</head>
<body>
<form id="form1" runat="server">
<div>
<asp:GridView ID="gv" runat="server">
<HeaderStyle BackColor="#444"  />
<Columns>
<asp:TemplateField>
<HeaderTemplate>
<asp:CheckBox ID="chkHeader" runat="server" />
</HeaderTemplate>
<ItemTemplate>
<asp:CheckBox ID="chkChild"  runat="server"/>
</ItemTemplate>
</asp:TemplateField>
</Columns>
</asp:GridView>
</div>
</form>
</body>
</html>

ADO.net ::

 if (!this.IsPostBack)
        {
            DataTable dt = new DataTable();
            dt.Columns.AddRange(new DataColumn[2] { new DataColumn("Name"), new DataColumn("Country") });
            dt.Rows.Add("John Hammond", "Canada");
            dt.Rows.Add("Rick Stewards", "United States");
            dt.Rows.Add("Huang He", "China");
            dt.Rows.Add("Mudassar Khan", "India");
            gvUserInfo.DataSource = dt;
            gvUserInfo.DataBind();
        }


Thursday, January 17, 2013

Read content of text file while uploading with out saving in server folder

  string InputFileText;
        long InputFileLength;
        UTF8Encoding encoder;
        byte[] btInputFile;
        InputFileText = string.Empty;
        InputFileLength = 0;
        encoder = new UTF8Encoding();
        InputFileLength = FileUpload1.PostedFile.InputStream.Length;
        btInputFile = new byte[InputFileLength];
        FileUpload1.PostedFile.InputStream.Seek(0, SeekOrigin.Begin);
        FileUpload1.PostedFile.InputStream.Read(btInputFile, 0, btInputFile.Length);
        InputFileText = encoder.GetString(btInputFile);


.......Happy Coding.......

Tuesday, September 25, 2012

Create thumb nail in diffrent sizes

Copy past below code in  .aspx page 


<form id="form1" runat="server">
    <div>
        <asp:Label ID="labelMessage" runat="server" Text="Browse Image:" ForeColor="navy" Width="220"></asp:Label>
        <asp:FileUpload ID="FileUpload1" runat="server" />
        <asp:Button ID="Upload" runat="server" Text="Upload" OnClick="Upload_Click" />
    </div>

    <div>
        <asp:Label ID="label1" runat="server" Text="Normal Image (Full size): " ForeColor="navy" Width="220"></asp:Label>
        <asp:Image ID="NormalImage" runat="server" />
    </div>

    <div>
        <asp:Label ID="label2" runat="server" Text="Thumbnail Small Image (50x50)px: " ForeColor="navy" Width="220"></asp:Label>
        <asp:Image ID="ThumbnailImageS" runat="server" />
    </div>

    <div>
        <asp:Label ID="label3" runat="server" Text="Thumbnail Large Image (100x100)px: "
ForeColor="navy" Width="220"></asp:Label>
        <asp:Image ID="ThumbnailImageM" runat="server" />
    </div>
</form>

Create  1 main  folder  for images

1.   Image

Create  2 sub folders to above "image "  folder

1.  S  (for small images )
2. L   (for for big images.


Copy past the below code in   .aspx.cs   page.

using System;
using System.Data;
using System.Configuration;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using System.Web.UI.HtmlControls;

public partial class _Default : System.Web.UI.Page
{
    protected void Page_Load(object sender, EventArgs e)
    {
    }

    protected void Upload_Click(object sender, EventArgs e)
    {
        if (FileUpload1.HasFile)
        {
            FileUpload1.SaveAs(MapPath("~/Image/" + FileUpload1.FileName));
            System.Drawing.Image img1 = System.Drawing.Image.FromFile(MapPath("~/image/") + FileUpload1.FileName);

            System.Drawing.Image bmp1 = img1.GetThumbnailImage(50, 50, null, IntPtr.Zero);
            bmp1.Save(MapPath("~/thumbnail/S/") + FileUpload1.FileName);
            System.Drawing.Image bmp2 = img1.GetThumbnailImage(100, 100, null, IntPtr.Zero);
            bmp2.Save(MapPath("~/thumbnail/L/") + FileUpload1.FileName);
            NormalImage.ImageUrl = "~/Image/" + FileUpload1.FileName;
            ThumbnailImageS.ImageUrl = "~/thumbnail/S/" + FileUpload1.FileName;
            ThumbnailImageM.ImageUrl = "~/thumbnail/L/" + FileUpload1.FileName;
        }
    }
}

Friday, November 11, 2011

Virtual base classes

36 down vote accepted
Virtual base classes, used in virtual inheritance, is a way of preventing multiple "instances" of a given class appearing in an inheritance hierarchy when using multiple inheritance.
Consider the following scenario:
class A { public: void Foo() {} }
class B : public A {}
class C : public A {}
class D : public B, public C {}
The above class hierarchy results in the "dreaded diamond" which looks like this:
  A
 / \
B   C
 \ /
  D
An instance of D will be made up of B, which includes A, and C which also includes A. So you have two "instances" (for want of a better expression) of A.
When you have this scenario, you have the possibility of ambiguity. What happens when you do this:
D d;
d.Foo(); // is this B's Foo() or C's Foo() ??
Virtual inheritance is there to solve this problem. When you specify virtual when inheriting your classes, you're telling the compiler that you only want a single instance.
class A { public: void Foo() {} }
class B : public virtual A {}
class C : public virtual A {}
class D : public B, public C {}
This means that there is only one "instance" of A included in the hierarchy. Hence
D d;
d.Foo(); // no longer ambiguous
Hope that helps as a mini summary. For more information, have a read of this and this. A good example is also available here.

Monday, November 7, 2011

.Net Integration with Bill Desk Payment Gateway

reffwith this blog :http://thelazybubble.blogspot.com/2011/10/integration-with-bill-desk-payment.html

 .Net Integration with Bill Desk Payment Gateway

         Introduction:
Now-a-days online shopping websites has become very popular, and to handle the secure Payment transactions, these are relying on popular third part Payment gateways like Billdesk, paypal etc.

BillDesk is the Payment Transaction Interface which allows the secure payment through Credit card/Online  Banking transaction.

Step-by-step Transaction Process:
a.       Customer logs-in at the merchant website, chooses the product/service that he intends to purchase.
b.      Customer then decides to make payment at merchant’s website.
c.       Merchant website will log the order by generating a Unique Order Number; and establish a connection with the BillDesk Payment Gateway Interface [refer the section on Payment Request].
d.      At the BillDesk Payment Gateway; the customer is displayed with various ‘payment options’ that the customer can use. These would include – Credit Card; Online Net Banking.
e.      Customer chooses the payment option at BillDesk Payment Gateway, and is taken to the page of that specific bank [if Netbanking option is chosen]. Customer then enters the relevant authentication details [ie, User ID/ Card Number/ Password] at the bank’s website; and then is requested to confirm the payment amount.
If the customer chooses to pay using Credit card then a payment page with the look and feel of the merchant is displayed for the user to make a payment.
f.        Customer’s account is debited and the Customer is then directed back to the designated Return URL [RU] at Merchant website.
g.       The BillDesk Payment Gateway will provide the return response to the designated Merchant return URL received in the initial transaction request. Merchant can use this response to update its system and display to the customer that the payment process was successful.
h.       BillDesk payment gateway also generates a unique Transaction ID against each order number that is received – this could be displayed to the customer; and used for any queries relating to the transaction.
Payment Request:
After the customer clicks on PAY [within Merchant website], a request needs to be generated by Merchant to following BillDesk URL for each payment with the parameters indicated:

https://www.billdesk.com/pgidsk/pgijsp/MerchantPaymentoption.jsp
[The above URL is for example purpose only. And will be unique for each Merchant.]

A brief explanation of these parameters is below:
Parameter Name
Description
Sample Value
txtCustomerID
Order Number
1073234
txtTxnAmount
Total value of Transaction Rs.Ps.
2400.30
txtAdditionalInfo1
Source
Identity of Merchant website with Billdesk
txtAdditionalInfo2
Currency
INR or USD or GBP or EUR
txtAdditionalInfo3
Homestays
Kerela Backwaters
txtAdditionalInfo4
Arrival Date
25-Sep-09
txtAdditionalInfo5
Depature Date
28-Sep-09
txtAdditionalInfo6
Guests
2
txtAdditionalInfo7
Rooms
1
RU
Return URL – this dynamic return URL of the merchant where the online return response has to be received for that transaction
Note: Parameters are case sensitive.

Example:

<form name=’abc’ method='POST'  
action='https://www.billdesk.com/pgidsk/pgijsp/MerchantPaymentoption.jsp'>
  <input type='hidden' name='txtCustomerID' value='1073234'>
  <input type='hidden' name='txtTxnAmount' value='2400.30'>
  <input type='hidden' name=' txtAdditionalInfo1' value='  
    Identity of Merchant website with Billdesk '>
  <input type='hidden' name=' txtAdditionalInfo2' 
    value='USD'>
  <input type='hidden' name=' txtAdditionalInfo3'      
    value='Kerala Backwaters'>
  <input type='hidden' name=' txtAdditionalInfo4' value='25-
    Sep-08'>
  <input type='hidden' name=' txtAdditionalInfo5' value='28-
    Sep-08'>
  <input type='hidden' name=' txtAdditionalInfo6' value='2'>
  <input type='hidden' name=' txtAdditionalInfo7' value='1'>
  <input type='hidden' name='RU' 
    value='https://payment.merchant.com'>
     </form>
No.
Area
Description
1
Secure BillDesk URL
Always use “https” for the BillDesk URL where the request will
be posted.
2
POST method
* Always Use “POST” method
* Variables must be sent as HIDDEN values
3
Referral URL
Always call the BillDesk production URL from the Referral URL
only; which needs be shared at the time of integration.
4
Length of parameters
Each parameter field should not be more than 120 characters.
A ‘NULL’ value will not be accepted for any parameter.
5
Disallowed characters
Special characters are disallowed in the parameters that are
sent to BillDesk. For example:
%
;
'
"
^
`
$
6
Transaction Amount
During the test phase of the integration, only Rs. 2 can be
used as a transaction amount.
7
Parameter Name
Parameter names (sent to BillDesk) are case-sensitive
Payment Response
Once the Payment transaction is done in the Billdesk website, the payment response is sent to the Return URL [RU] specified dynamically by Merchant for each transaction.

This response is the “Form submit” and can be retrieved by – Request.Form[“msg”]
Response Message description:
MerchantID|CustomerID|TxnReferenceNo|BankReferenceNo|TxnAmount|BankID|BankMerchantID|TxnType|CurrencyName|ItemCode|SecurityType|SecurityID|SecurityPassword|TxnDate|AuthStatus|SettlementType|AdditionalInfo1|AdditionalInfo2|AdditionalInfo3|AdditionalInfo4|AdditionalInfo5|AdditionalInfo6|AdditionalInfo7|ErrorStatus|ErrorDescription|CheckSum
For example, suppose the Response message for a particular transaction is as follows:
MAHINDRAID|c7b9b0|MEPG9999999999|200911106652263|7800.00|EPG|NA|NA|INR|DIRECT|NA|NA|NA|10-11-2009 11:00:56|0300|NA|HOMESTAYS|INR|BBEstate-Coorg-Karnataka|17-Nov-09|20-Nov-09|3|1|NA|Transaction Successful|717696825
Please note – MERCHANTID and the CHECKSUM KEY would be provided at the time of
integration.
Payment updation process at Merchant end
The following process should be followed at Merchant end for receiving and processing the
payment response:

                          I.      Receive and Read the Payment Response message – msg at the Return URL

                        II.      Generate the ‘checksum value’ for the Payment Response and validate it with the ‘checksum value’ received in the Payment Response. If they match; proceed to step (c) below; else display a Payment Rejection message to the customer.

                      III.      Update the original record in the merchant system based on the ‘AuthStatus’ field received in the Payment Response. Refer the table below for various values that are received in the AuthStatus field, and the related Transaction Status. The updation to
the original record must be done as follows:

Successful transaction [AuthStatus – 0300]

Update <record> set STATUS = ‘SUCCESS’ where ORIGINALSTATUS=’PENDING’ and ORDERNUMBER=’
1073234’ and TRANSACTIONAMOUNT=’2400.30’

Failure transaction [AuthStatus – other than 0300]

Update <record> set STATUS = ‘FAILURE’ where ORIGINALSTATUS=’PENDING’ and ORDERNUMBER=’
1073234’ and TRANSACTIONAMOUNT=’2400.30’

                      IV.      The above updation process ensures the following:
i)   Only the original record is updated [through the Unique Order 
Number]
ii)  The record is updated only once [for original status=PENDING]
iii) The record is updated for the same ‘Transaction Amount’ that was 
initiated by the merchant.
Authorization status:
AuthStatus
Status Reason
Proposed Transaction Status
0300
Success
Successful Transaction
0399
Invalid Authentication at Bank
Cancel Transaction
NA
Invalid Input in the Request Message
Cancel Transaction
0002
Billdesk waiting for the response from bank
Cancel Transaction
0001
Error at Billdesk
Cancel Transaction
For all AuthStatus that is not a Success, an ErrorDescription would be provided in the Payment Response.
No.
Area
Description
1
Checksum Validation
Always validate the checksum before updating the transaction
Response
2
Verify whether the
updation is as per the
process specified in
the interface
document
Only the original record is updated [through the Unique Order Number]
The record is updated only once [for original status=PENDING]
The record is updated for the same ‘Transaction Amount’ that was initiated by the merchant.
Sample Code:
In the Merchant website, the Page use the “Post method” to send the variables to the Billdesk website

<html>
<head id="Head1" runat="server">
    <title>Payment</title>
<script type="text/javascript">
    function myfunc ()
    {
    var frm = document.all("form2");
    frm.submit();
    }
    window.onload = myfunc;
</script>
</head>
<body>
    <form id="form2" method="post" action="https://www.billdesk.com/ Paymentoption.jsp" name="form2">
        <input type="hidden" name="txtCustomerID" 
               value="<%=Request("txtCustomerID")%>" />
        <input type="hidden" name="txtTxnAmount" 
               value="<%=Request("txtTxnAmount")%>" />
             <input type="hidden" name="txtAdditionalInfo1" 
                    value="<%=Request("txtAdditionalInfo1")%>" />

        <input type="hidden" name="txtAdditionalInfo2" 

               value="<%=Request("txtAdditionalInfo2")%>" />

        <input type="hidden" name="txtAdditionalInfo3" 

               value="<%=Request("txtAdditionalInfo3")%>" />
        <input type="hidden" name="txtAdditionalInfo4"                
               value="<%=Request("txtAdditionalInfo4")%>" />
        <input type="hidden" name="txtAdditionalInfo5" 
               value="<%=Request("txtAdditionalInfo5")%>" />
        <input type="hidden" name="txtAdditionalInfo6" 
               value="<%=Request("txtAdditionalInfo6")%>" />
        <input type="hidden" name="txtAdditionalInfo7" 
               value="<%=Request("txtAdditionalInfo7")%>" />
        <input type="hidden" name="RU"          value="http://www.mahindrahomestays.com/Pages/confirmation.aspx" />
     </form>
</body>
     </html> 

  
Once the Payment is done, the Bill Desk webiste posts the Response string to the Merchant website, in the form of a variable ie; “msg”.

The following sample code to be written to receive the response variable from the Billdesk website.

string _paymentResp = Request.Form["msg"];                      
string[] arrResponse = _paymentResp.Split('|'); //PG
     string merchantId = arrResponse[0];
     string _customerId = arrResponse[1];
     string txnReferenceNo = arrResponse[2];
     string bankReferenceNo = arrResponse[3];
     string txnAmount = Convert.ToDecimal(arrResponse[4]);
     string bankId = arrResponse[5];
     string bankMerchantId = arrResponse[6];
     string txnType = arrResponse[7];
     string currency = arrResponse[8];
     string itemCode = arrResponse[9];
     string securityType = arrResponse[10];
     string securityId = arrResponse[11];
     string securityPassword = arrResponse[12];
     string txnDate = arrResponse[13]; //dd-mm-yyyy
     string authStatus = arrResponse[14];
     string settlementType = arrResponse[15];
     string additionalInfo1 = arrResponse[16];
     string additionalInfo2 = arrResponse[17];
     string additionalInfo3 = arrResponse[18];
     string additionalInfo4 = arrResponse[19];
     string additionalInfo5 = arrResponse[20];
     string additionalInfo6 = arrResponse[21];
     string additionalInfo7 = arrResponse[22];
     string errorStatus = arrResponse[23];
     string _errorDescription = arrResponse[24];