Related Posts Plugin for WordPress, Blogger...

About

Follow Us

Tuesday, 31 March 2015

Introduction:
In this article  I will explain how to add checkboxes in asp.net gridview and get gridview selected rows data on button click in asp.net  and then we can work with the data for further processing.


Introduction: 
Sometime it is needed to empty the div or remove the div while working with ASP.NET and Jquery. In jQuery there are two functions empty() function and remove() which are used to empty or remove the div.
Introduction: 
Using Jquery we can search a given string for a specific word. In this article I will explain how to use jQuery to search a specific word in given input string.
Introduction: 
Using Jquery we can get selected value of Radiobutton list by name of radio button list. This can be done by using server side code but using jquery it is fast and easy to implement.

Monday, 30 March 2015

Introduction: 
Using Jquery we can check whether Radiobutton is selected or not. This can be done by using server side code but using jquery it is fast and easy to implement.
Introduction
In this article I will explain how to find ceiling value using Jquery or Javascript. We will use
Math.ceil() or  method. Math.ceil() to find the result.
Introduction:

We can add and remove Indexes on table in sql server. Indexes can be added and drop by using query in SQL server.

in this  I will explain how to remove index from table in sql server 2008 or drop index from table in sql server. To remove index from table we use drop index statement in sql server.
To create index on column in sql server that syntax will be like as shown below

Syntax to Create Index
CREATE INDEX indexname ON Tablename(columnname)
Example:

CREATE INDEX IC_Userid ON UserDetails(UserId)

Remove index on table


Syntax to Drop Index on Column
DROP INDEX tablename.indexname
Example:


DROP INDEX UserDetails.IC_Userid
Introduction:
When create table and set Primary key, an index will be created automatically. But we can also set index manually.

I this article I will explain how to create index on column in  
or create index on multiple columns in sql server or create index on table in sql server 2008 with example.
Create Index on Single Column:

Syntax to Create Index
CREATE INDEX indexname ON Tablename(columnname)
Example:

CREATE INDEX IC_Empid  ON EmpDetails(EmpId)

Create nonclustered index on table

Syntax to Cre ate NonClustered Index on Column
CREATE NONCLUSTERED INDEX indexname ON Tablename(columnname)
Example:

CREATE NONCLUSTERED INDEX NC_Empid ON EmpDetails(EmpId)

create index on multiple columns at a time

Syntax to Create Index on Multiple Columns
CREATE INDEX IC_Empid ON Table_Name(Col1,Cpl2)
Example:


CREATE INDEX IC_Empid ON EmpDetails(EmpId,EmpName)

Saturday, 28 March 2015

Here in this article I will explain how to use jQuery to get or find elements with class name or id. We can get elements (such as div) by using class name or id easily in jQuery.

 

 DetailsView is a data control which is used to display single record from a data  table. It allows us to perform the operations like insert, edit, update and delete records.

Friday, 27 March 2015

In this Article I have explained how to show record in Form view data control. In this control we can show data one by one. If there is a requirement to show data one by one then this is very useful control.

Thursday, 26 March 2015

We can bind or load Listbox control from database to show dynamic values. In this article I am going to explain how to bind or fill ListBox control from back end database e.g. Sql Server and How to get selected Item and selected Value from ListBox control.
Introduction:
While working with Password type textboxes i.e. Textbox with TextMode =”Password”, when postback occurs, the value for these textboxes will be lost. We need to enter password again, which is not user friendly.
Introduction:  In this article I will explain the reason and solution to fix to the error “Validation of viewstate MAC failed.
Why this occurs:
If this application is hosted by a Web Farm or cluster, ensure that <machineKey> configuration specifies the same validationKey and validation algorithm. AutoGenerate cannot be used in a cluster. View state data that is transferred between the client and the server is always validated to ensure that the ViewState data is not tampered. As the ViewState data is encrypted and decrypted, a unique key is used to encrypt/decrypt this data. When the application is hosted on a single machine, then there is no issue as the key will always be same for both encryption and decryption process. But this will not be the case in web farm because this key value will be different across the servers.

Solution:
There are three solutions to fix this issue:

1.      First Method : is to set the EnableViewStateMac to false in the web.config:
      <system.web>

<pages enableViewStateMac="false">
        .
        .
        .
 </pages>
     </system.web>
2.      Second Method:  is to set the EnableViewStateMac to false at page level as:
<%@ Page EnableViewStateMac="false" Language="C#" AutoEventWireup="true"CodeFile="Default.aspx.cs" Inherits="_Default" %>
But in case of large no of web pages it’s not possible to make changes on every page.

3.      Third Method:  Best and Recommended solution is to specify our own value for encryption and decryption in the web.config file i.e. Machine Key. We can generate the machine key via the Unique Machine KeyGenerator. Below is the sample keys. 
<system.web>
<machineKeyvalidationKey='D3A686722DDE36968147312E2D0EF0F61AC13C1725723317ABE201CE98EF3876E962748E28307308BBA1B4C9E670D52822C8B19E35657725C798FA51E6641F0C'decryptionKey='85C571FEEBFAF94517FAAC3136A29CAAA800033B909EDB52'validation='SHA1'/>
</system.web>

 Generate your own keys and replace the validationKey and decryptionKey with your own unique generated keys.

All methods are useful in solving this problem. But it is recommended to use machine keyin web config file. This is the best solution an less time consuming. Other reason is secutity, because when we set the EnableViewStateMac value to false we expose our application to security threats.