<asp:CompareValidatorID="cmp3"runat="server"ControlToValidate="txtpercentage"Operator="DataTypeCheck"Type="Double"ErrorMessage="Enter Numeric Value Alone"Display="dynamic"ValidationGroup="subject">asp:CompareValidator>
ItemTemplate>
asp:TemplateField>
Columns>
<EmptyDataTemplate>
<tablewidth="100%"cellpadding="5"cellspacing="5">
<tr><tdalign="center"valign="middle"><spanclass="redcolor">No Data Foundspan>td>tr>
table>
EmptyDataTemplate>
<RowStyleCssClass="nestedtable"/>
<HeaderStyleCssClass="tableheadbg"/>
<AlternatingRowStyleCssClass="nestedtable1"/>
asp:GridView>
ContentTemplate>
asp:UpdatePanel>
And in the Code Behind:
ProtectedSub txtmarksobtain _TextChanged(ByVal sender AsObject, ByVal e As System.EventArgs) Handles txtmaxmarks.TextChanged
ForEach gv As GridViewRow In gvattend.Rows
Dim txtmarksobtain As TextBox = DirectCast(gv.FindControl("txtmarksobtain"), TextBox)
First we need to convert the string to lower.. Only then the System.Globalization.CultureInfo.CurrentUICulture class will convert the string to Title Case.
So many of us stuck up with the problem of Postback during URL rewriting. During Postback the Url breaks up and throws error. Here is a solution to overcome this.We need to write this script in the last of the page (ie. In The Body Section.)
This is the stored procedure which is used to fill the datalist and lets see the attributes used here.
·The startRowIndex is the one which sets the initial row to display and this calculates the rowindex of records to be displayed in that particular page.
·the pageSize denotes the number of records per page,
·totalCount gets the total number of records returned by the select command
Code Behind :
Declarations:
int _startIndex = 0;
int _thisPage = 1;
int _pageSize = 10;
int _totalNumberOfRows = 0;
string sPage;
SqlConnection con = newSqlConnection(ConfigurationManager.ConnectionStrings["Connection"].ConnectionString);
privatevoid BindGridView ()
{
DataTable dTable = newDataTable();
using (SqlConnection conn = newSqlConnection(connStr))
GetPaging is the function which Is used to perform the paging as per our requirement. Here I have customised the GetPaging function to return only 10 pagenumbers. So the Literal control displays only 10 page numbers in between the Previousand Next links and this can be modified according to your requirement.
You could see the page numbers between the links. This pagenumber will be passed through the query string for calculating the startindex and rowindex of the records to be displayed. Moreover this paging is SEO friendly.
BindGridView is the function which executes the stored procedure.
And now in my PageLoad my function is called as below..