السلام عليكم ورحمة الله وبركاته
يا اخوان لدي مشكلة في التصفح (paging) في gridview وهي عندما أقوم بالضغط على رقم الصفحة التي اريد ان انتقل اليها في الgridview يحدث هناك خطأ وهو:
Input string was not in a correct format
ويظهر هذا الخطأ على الجملة
اقتباسDim index As Integer = Convert.ToInt32(e.CommandArgument)
وإليكم أكواد الgridview لمساعدتي في معرفة الخطأ وحله بإذن الله
اقتباس<asp:GridView ID="GridView2" runat="server" AutoGenerateColumns="False"
BackColor="White" BorderColor="#333333" BorderStyle="Solid" BorderWidth="1px"
CellPadding="0" DataKeyNames="meet_no" DataSourceID="AccessDataSource2"
ForeColor="Black" GridLines="Vertical" Width="889px" AllowPaging="True"
style="font-weight: 700; text-align: center; vertical-align: middle;"
AllowSorting="True" HorizontalAlign="Center"
Caption="قائمة بالإجتماعات المغلقة" Font-Size="Small" PageSize="15">
<FooterStyle BackColor="#CCCC99" />
<RowStyle BackColor="#CCCCCC" />
<Columns>
<asp:BoundField DataField="meet_no"
SortExpression="meet_no" InsertVisible="False" ReadOnly="True" >
<ControlStyle BackColor="#333333" BorderColor="#333333" Font-Size="1pt"
ForeColor="#333333" Width="1px" Font-Names="Cordia New" />
<FooterStyle BackColor="#333333" BorderColor="#333333" Font-Size="1pt"
ForeColor="#333333" Width="1px" Font-Names="Cordia New" />
<HeaderStyle BackColor="#333333" BorderColor="#333333" Font-Bold="False"
Font-Size="1pt" ForeColor="#333333" Width="1px" Font-Names="Cordia New" />
<ItemStyle BackColor="#333333" BorderColor="#333333" Font-Size="1pt"
ForeColor="#333333" Width="1px" Font-Names="Cordia New" />
</asp:BoundField>
<asp:TemplateField HeaderText="الموضوع" SortExpression="meet_subj">
<EditItemTemplate>
<asp:TextBox ID="TextBox1" runat="server" Text='<%# Bind("meet_subj") %>'></asp:TextBox>
</EditItemTemplate>
<ItemTemplate>
<asp:LinkButton ID="Label1" runat="server" Text='<%# Bind("meet_subj") %>'></asp:LinkButton>
</ItemTemplate>
</asp:TemplateField>
<asp:BoundField DataField="meet_main_dept" HeaderText="الإدارة المنظمة"
SortExpression="meet_main_dept" >
<ControlStyle Width="105px" />
<FooterStyle Width="105px" />
<HeaderStyle Width="105px" />
<ItemStyle Width="105px" />
</asp:BoundField>
<asp:BoundField DataField="meet_date" HeaderText="التاريخ"
SortExpression="meet_date" DataFormatString="{0:MM-dd-yyyy}" >
<ControlStyle Width="70px" />
<FooterStyle Width="65px" />
<HeaderStyle Width="65px" />
<ItemStyle Width="70px" />
</asp:BoundField>
<asp:BoundField DataField="meet_time" HeaderText="الوقت"
SortExpression="meet_time" DataFormatString="{0:t}" >
<ControlStyle Width="60px" />
<FooterStyle Width="60px" />
<HeaderStyle Width="60px" />
<ItemStyle Width="60px" />
</asp:BoundField>
<asp:BoundField DataField="duration" HeaderText="المدة"
SortExpression="duration" >
<ControlStyle Width="30px" />
<FooterStyle Width="30px" />
<HeaderStyle Width="30px" />
<ItemStyle Width="30px" />
</asp:BoundField>
<asp:BoundField DataField="meet_location" HeaderText="المكان"
SortExpression="meet_location" >
<ControlStyle Width="95px" />
<FooterStyle Width="95px" />
<HeaderStyle Width="95px" />
<ItemStyle Width="95px" />
</asp:BoundField>
</Columns>
<PagerStyle BackColor="White" ForeColor="Black" HorizontalAlign="Right" />
<SelectedRowStyle BackColor="#666666" Font-Bold="True" ForeColor="White" />
<HeaderStyle BackColor="#333333" Font-Bold="True" ForeColor="White" />
<AlternatingRowStyle BackColor="White" />
</asp:GridView>
أما كود الvb فهو:
اقتباسProtected Sub GridView2_RowCommand(ByVal sender As Object, ByVal e As System.Web.UI.WebControls.GridViewCommandEventArgs) Handles GridView2.RowCommand
Dim index As Integer = Convert.ToInt32(e.CommandArgument)
Dim row As GridViewRow = GridView2.Rows(index)
Session("ddlValue3") = CType(row.Cells(0), DataControlFieldCell).Text
Session("subject") = CType(row.Cells(1), DataControlFieldCell).Text
Dim lb As LinkButton = CType(e.CommandSource, LinkButton)
Response.Redirect("closed_meet.aspx?meet_subj=" + lb.Text) 'redirecting
End Sub
أرجو مساعدتي وجزاكم الله خيراً