تقييم الموضوع :
  • 0 أصوات - بمعدل 0
  • 1
  • 2
  • 3
  • 4
  • 5
طلب واستفسار عن كود membership Filter
#1
السلام عليكم ورحمة الله

حياكم الله اخوتي الكرام

لدي استفسار عن كود اخوتي يهتم بفلترة بيانات العضو

مثلاً يوجد لدينا حقول الاسم والعمر والدولة وغير ذلك لعدد من الاعضاء

اريد البحث عنهم من خلال أمر Find

اريد كود VB.net يدعم صفحات Asp.net


وهنا حاولت استنبط الكود الخاص بالموقع ولكن لدي يظهر بعض الاخطاء

والموقع في المرفقات .. وأرجو حفظه للأمانة لأنه عمل خاص بالشركة لدي وهو أمانة في عنقي

هذا كود الكنترول

كود :
<%@ Control Language="VB" AutoEventWireup="false" CodeFile="MemberFilter.ascx.vb" Inherits="CTRL_WebUserControl" %>

<script>
   $(document).ready(function () {
       setTimeout(function () { $(".StatusMessageU").hide(); }, 5000);
   });
</script>


<asp:UpdatePanel id="UpdatePanel1" runat="server">
<ContentTemplate>
<div class="wrapperCNRL">

<asp:MultiView ID="MultiViewMember" runat="server"  ActiveViewIndex="0" >

<asp:View ID="ViewAll" runat="server" >

<div id="divTitle">
<div id="lblTitle" >All Member </div>
<asp:LinkButton ID="LinkButtonNewMember" runat="server" CssClass="LinkButtonNewItem">New Member</asp:LinkButton>
</div>


<asp:label ID="lblMsg" runat="server" CssClass="StatusMessageU" style="display:none;"></asp:label>
<asp:RegularExpressionValidator ID="RegularExpressionValidatorID" runat="server" CssClass="StatusMessage" ControlToValidate="TextBoxFilterID" ErrorMessage="please enter No in field ID"  SetFocusOnError="True" ValidationExpression="^[0-9]*$" ValidationGroup="A"></asp:RegularExpressionValidator>

 
<div id="divFilter" class="all">  

   <div id="lblFilter">Filter by</div>

   <div style="float:left;width:auto;margin-bottom: 3px; margin-right : 20px;">
   <asp:Label ID="Label1" runat="server" Text="ID"  style=" width: auto;float: left;padding-top: 4px;padding-right: 8px;"></asp:Label>
  <asp:TextBox ID="TextBoxFilterID" runat="server"   style="width: 70px;float: left;height:25px;border-radius:3px; text-align:center;" CssClass="txt" AutoPostBack="True"></asp:TextBox>
   </div>

   <div style="float:left;width:auto;margin-bottom: 3px; margin-right : 20px;">
   <asp:Label ID="Label2" runat="server" Text="Name" style="width: auto;float: left;padding-top: 4px;padding-right: 8px;  "></asp:Label>
   <asp:TextBox ID="TextBoxFilterName" runat="server" style="width: 250px;float: left;height:25px;border-radius:3px;  padding-left: 4px;"
           AutoPostBack="True" CssClass="txt"></asp:TextBox>
   </div>

   <div style="float:left;width:auto;margin-bottom: 3px; margin-right : 20px;">
   <asp:Label ID="Label3" runat="server" Text="CityName"  style="width: auto;float: left;padding-top: 4px;padding-right: 8px;"></asp:Label>
   <asp:TextBox ID="TextBoxFilterCityName" runat="server"  style="width: 250px;float: left;height:25px;border-radius:3px; padding-right: 4px;  padding-left: 4px; " CssClass="txt" AutoPostBack="True"></asp:TextBox>
   </div>
   <asp:Button ID="GO" runat="server" Text="GO" style="width: 50px;float: left;height: 26px;padding: 0px;margin: 0px 0px 0px 0px;cursor: pointer;" class="all" ValidationGroup="A" />
</div>

<div style="float:left;width:960px;margin:10px 0px;border: 1px solid #DDD;border-collapse: separate;-webkit-border-radius: 3px;-moz-border-radius: 4px;border-radius: 3px;padding: 0px" class="all">
<asp:Repeater ID="repeaterMember" runat="server"   OnItemCommand="repeaterMember_ItemCommand" OnItemDataBound="repeaterMember_ItemDataBound">
 
   <HeaderTemplate>
      <div style="float: left;width: 930px;clear: both;background-color: #F5F5F5;height: 17px;padding: 10px 10px 10px 20px;border-bottom-left-radius: 0px;color: #333;border-bottom-right-radius: 0px;border-top-left-radius: 3px;border-top-right-radius: 3px;font-size: 14px;border-bottom: 1px solid #DAD7D7;">

          <div style="float:left;width:75px">ID</div>
          <div style="float:left;width:150px">CreateDate</div>
          <div style="float:left;width:300px">Name</div>
          <div style="float:left;width:150px">CityName</div>
          <div style="float:left;width:150px">Address</div>
          <div style="float:left;width:150px">Note</div>
          <div style="float:left;width:150px">Password</div>
          <div style="float:left;width:150px">LevelMemberID</div>
          <div style="float:left;width:150px">CountryID</div>
          <div style="float:left;width:150px">isRealPeople</div>
          <div style="float:left;width:150px">Update</div>
          <div style="float:left;width:150px">Delete</div>
       </div>
   </HeaderTemplate>

   <ItemTemplate>

          <div id="Div1" class="<%# GetCssName(Container) %>" runat="server" >
          <div id="Div2" style="float:left;width:75px"><%# Eval("ID")%></div>
          <div id="Div3" style="float:left;width:150px"> <%# Eval("CreateDate")%></div>
          <div id="Div4" style="float:left;width:300px;height: 100%;"> <%# Eval("Name")%></div>
              <div id="Div6" style="float:left;width:150px"> <%# Eval("CityName")%></div>
              <div id="Div7" style="float:left;width:150px"> <%# Eval("Address")%></div>
              <div id="Div8" style="float:left;width:150px"> <%# Eval("Note")%></div>
              <div id="Div9" style="float:left;width:150px"> <%# Eval("Password")%></div>
              <div id="Div10" style="float:left;width:150px"> <%# Eval("LevelMemberID")%></div>
              <div id="Div11" style="float:left;width:150px"> <%# Eval("CountryID")%></div>
              <div id="Div12" style="float:left;width:150px"> <%# Eval("isRealPeople")%></div>

          <div style="float:left;width:150px"> <asp:LinkButton ID="LinkButtonUpdateMember"   runat="server" Style="color: #A73F3F;text-decoration: none;" CommandArgument='<%# Eval("ID")%>'  CommandName="Update" >Update</asp:LinkButton></div>
          <div style="float:left;width:150px"> <asp:LinkButton ID="LinkButtonDeleteMember"  runat="server" Style="color: #A73F3F;text-decoration: none;" CommandArgument='<%# Eval("ID")%>'  CommandName="Delete" >Delete</asp:LinkButton></div>
       </div>
   </ItemTemplate>


   <FooterTemplate>
       <asp:Label ID="lblErrorMsg" runat="server" CssClass="errMsg" Text="Sorry, no item is there to show." Visible="false"></asp:Label>
       

   </FooterTemplate>
   
</asp:Repeater>
 </div>        

   
</asp:View>

<%--<asp:View ID="ViewUpdate" runat="server">
 

<div style="float:left;width:930px;margin: 29px 0px 13px 0px;height: 25px;background: url('/CnPn/images/title.png') no-repeat 0% 26%;border: 0px;" class="all">
<div style="color: #775252;font-size: 18px;margin: 0px 0px 2px 15px;float: left;font-family: 'Alef', sans-serif; ">Update Member</div>
<asp:LinkButton ID="LinkButtonMemberUpdate" runat="server"
       Style="color: #A73F3F;text-decoration: none;float: right;margin: 0px 0px 0px 10px;text-align: left;font-size: 15px;"  >Save</asp:LinkButton>
<div Style="color: #A73F3F;text-decoration: none;float: right;margin: 0px 10px 0px 10px;text-align: left;font-size: 15px;">|</div>    
<asp:LinkButton ID="LinkButtonMemberCancel" runat="server"
       Style="color: #A73F3F;text-decoration: none;float: right;margin: 0px 10px 0px 10px;text-align: left;font-size: 15px;"  >Cancel</asp:LinkButton>

</div>
 
<div style="float:left;width:960px;margin:10px 0px;border: 1px solid #DDD;border-collapse: separate;-webkit-border-radius: 3px;-moz-border-radius: 4px;border-radius: 3px;padding: 0px;height: auto;" class="all">
   
      <div style="float: left;width: 930px;clear: both;background-color: #F5F5F5;height: 17px;padding: 10px 10px 10px 20px;border-bottom-left-radius: 0px;color: #333;border-bottom-right-radius: 0px;border-top-left-radius: 3px;border-top-right-radius: 3px;font-size: 14px;border-bottom: 1px solid #DAD7D7;">
     
            <div style="float:left;width:75px">ID</div>
           <div style="float:left;width:150px">CreateDate</div>
           <div style="float:left;width:300px">Name</div>
          <div style="float:left;width:150px">CityName</div>
          <div style="float:left;width:150px">Address</div>
          <div style="float:left;width:150px">Note</div>
          <div style="float:left;width:150px">Password</div>
          <div style="float:left;width:150px">LevelMemberID</div>
          <div style="float:left;width:150px">CountryID</div>
          <div style="float:left;width:150px">isRealPeople</div>
           
       </div>
   
      <div id="Div2" class="odd" runat="server" style="height: 160px;">
          <div style="float:left;width:75px"> <asp:Label ID="lblMemberUpdateID"runat ="server" ></asp:Label></div>
          <div style="float:left;width:250px"><asp:TextBox ID="TextBoxCreatDateUpdate"runat="server" style="float:left;width:230px;float: left;border-top-left-radius: 3px;border-top-right-radius: 3px;border-bottom-right-radius: 3px;border-bottom-left-radius: 3px;border: 1px solid #ABADB3;resize: none;padding: 5px;color: #929292;"></asp:TextBox></div>
          <div style="float:left;width:300px;height: 150px;"><asp:TextBox ID="TextBoxNameUpdate"  TextMode="MultiLine" runat="server" style="margin: 2px;width: 270px;height: 150px;float: left;border-top-left-radius: 3px;border-top-right-radius: 3px;border-bottom-right-radius: 3px;border-bottom-left-radius: 3px;border: 1px solid #ABADB3;resize: none;padding: 5px;color: #929292;"></asp:TextBox></div>
          <div style="float:left;width:250px"><asp:TextBox ID="TextBoxCityNameUpdate"runat="server" style="float:left;width:230px;float: left;border-top-left-radius: 3px;border-top-right-radius: 3px;border-bottom-right-radius: 3px;border-bottom-left-radius: 3px;border: 1px solid #ABADB3;resize: none;padding: 5px;color: #929292;"></asp:TextBox></div>
          <div style="float:left;width:250px"><asp:TextBox ID="TextBoxAddressUpdate"runat="server" style="float:left;width:230px;float: left;border-top-left-radius: 3px;border-top-right-radius: 3px;border-bottom-right-radius: 3px;border-bottom-left-radius: 3px;border: 1px solid #ABADB3;resize: none;padding: 5px;color: #929292;"></asp:TextBox></div>
          <div style="float:left;width:250px"><asp:TextBox ID="TextBoxNoteUpdate"runat="server" style="float:left;width:230px;float: left;border-top-left-radius: 3px;border-top-right-radius: 3px;border-bottom-right-radius: 3px;border-bottom-left-radius: 3px;border: 1px solid #ABADB3;resize: none;padding: 5px;color: #929292;"></asp:TextBox></div>
          <div style="float:left;width:250px"><asp:TextBox ID="TextBoxPasswordUpdate"runat="server" style="float:left;width:230px;float: left;border-top-left-radius: 3px;border-top-right-radius: 3px;border-bottom-right-radius: 3px;border-bottom-left-radius: 3px;border: 1px solid #ABADB3;resize: none;padding: 5px;color: #929292;"></asp:TextBox></div>
          <div style="float:left;width:250px"><asp:TextBox ID="TextBoxLevelMemberIDUpdate"runat="server" style="float:left;width:230px;float: left;border-top-left-radius: 3px;border-top-right-radius: 3px;border-bottom-right-radius: 3px;border-bottom-left-radius: 3px;border: 1px solid #ABADB3;resize: none;padding: 5px;color: #929292;"></asp:TextBox></div>
          <div style="float:left;width:250px"><asp:TextBox ID="TextBoxCountryIDUpdate"runat="server" style="float:left;width:230px;float: left;border-top-left-radius: 3px;border-top-right-radius: 3px;border-bottom-right-radius: 3px;border-bottom-left-radius: 3px;border: 1px solid #ABADB3;resize: none;padding: 5px;color: #929292;"></asp:TextBox></div>
          <div style="float:left;width:250px"><asp:TextBox ID="TextBoxisRealPeopleUpdate"runat="server" style="float:left;width:230px;float: left;border-top-left-radius: 3px;border-top-right-radius: 3px;border-bottom-right-radius: 3px;border-bottom-left-radius: 3px;border: 1px solid #ABADB3;resize: none;padding: 5px;color: #929292;"></asp:TextBox></div>
      </div>
   


 </div>        

</asp:View>--%>

<asp:View ID="ViewDelete" runat="server" >

<div style="float:left;width:930px;margin: 29px 0px 13px 0px;height: 25px;background: url('/CnPn/images/title.png') no-repeat 0% 26%;border: 0px;" class="all">
<div style="color: #775252;font-size: 18px;margin: 0px 0px 2px 15px;float: left;font-family: 'Alef', sans-serif; ">Delete Member</div>
<asp:LinkButton ID="LinkButtonConfirmDelete" runat="server"   Style="color: #A73F3F;text-decoration: none;float: right;margin: 0px 0px 0px 10px;text-align: left;font-size: 15px;" AutoPostBack="true">Confirm</asp:LinkButton>
<div Style="color: #A73F3F;text-decoration: none;float: right;margin: 0px 10px 0px 10px;text-align: left;font-size: 15px;">|</div>    
<asp:LinkButton ID="LinkButtonCancelDelete" runat="server" AutoPostBack="true"   Style="color: #A73F3F;text-decoration: none;float: right;margin: 0px 10px 0px 10px;text-align: left;font-size: 15px;">Cancel</asp:LinkButton>

</div>
 

 

<div style="float:left;width:960px;margin:10px 0px;border: 1px solid #DDD;border-collapse: separate;-webkit-border-radius: 3px;-moz-border-radius: 4px;border-radius: 3px;padding: 0px" class="all">
      <div style="float: left;width: 930px;clear: both;background-color: #F5F5F5;height: 17px;padding: 10px 10px 10px 20px;border-bottom-left-radius: 0px;color: #333;border-bottom-right-radius: 0px;border-top-left-radius: 3px;border-top-right-radius: 3px;font-size: 14px;border-bottom: 1px solid #DAD7D7;">
     
           <div style="float:left;width:75px">ID</div>
           <div style="float:left;width:150px">Name</div>
           <div style="float:left;width:300px">CityName</div>
         
       </div>
   
      <div id="Div1" class="odd" runat="server" >
          <div style="float:left;width:75px">
               <asp:Label ID="lblMemberDeleteID" runat ="server" ></asp:Label>
           </div>
          <div style="float:left;width:250px">
                <asp:Label ID="LabelNameDelete" runat="server"
                   style="float:left;width:230px;float: left;"></asp:Label>
           </div>
          <div style="float:left;width:300px;height: 150px;">
                <asp:Label ID="LabelCityNameDelete"  TextMode="MultiLine" runat="server" style="width: 270px;float: left;"></asp:Label>
           </div>        
       </div>
</div>        

</asp:View>

<asp:View ID="ViewAdd" runat="server">
 

<div style="float:left;width:930px;margin: 29px 0px 13px 0px;height: 25px;background: url('/CnPn/images/title.png') no-repeat 0% 26%;border: 0px;" class="all">
<div style="color: #775252;font-size: 18px;margin: 0px 0px 2px 15px;float: left;font-family: 'Alef', sans-serif; ">Add New Member</div>
<asp:LinkButton ID="ButtonNew" runat="server" Style="color: #A73F3F;text-decoration: none;float: right;margin: 0px 0px 0px 10px;text-align: left;font-size: 15px;" ValidationGroup="A" AutoPostBack="false">Save</asp:LinkButton>
<div Style="color: #A73F3F;text-decoration: none;float: right;margin: 0px 10px 0px 10px;text-align: left;font-size: 15px;">|</div>    
<asp:LinkButton ID="ButtonNewCancel" runat="server" Style="color: #A73F3F;text-decoration: none;float: right;margin: 0px 10px 0px 10px;text-align: left;font-size: 15px;" AutoPostBack="false" >Cancel</asp:LinkButton>

</div>
 
<div style="float:left;width:960px;margin:10px 0px;border: 1px solid #DDD;border-collapse: separate;-webkit-border-radius: 3px;-moz-border-radius: 4px;border-radius: 3px;padding: 0px;height: auto;" class="all">
   
      <div style="float: left;width: 930px;clear: both;background-color: #F5F5F5;height: 17px;padding: 10px 10px 10px 20px;border-bottom-left-radius: 0px;color: #333;border-bottom-right-radius: 0px;border-top-left-radius: 3px;border-top-right-radius: 3px;font-size: 14px;border-bottom: 1px solid #DAD7D7;">
     
          <div style="float:left;width:75px">ID</div>
           <div style="float:left;width:150px">CreateDate</div>
           <div style="float:left;width:300px">Name</div>
          <div style="float:left;width:150px">CityName</div>
          <div style="float:left;width:150px">Address</div>
          <div style="float:left;width:150px">Note</div>
          <div style="float:left;width:150px">Password</div>
          <div style="float:left;width:150px">LevelMemberID</div>
          <div style="float:left;width:150px">CountryID</div>
          <div style="float:left;width:150px">isRealPeople</div>
       </div>
   
      <div id="Div5" class="odd" runat="server" style="height: 160px;">

          <div style="float:left;width:75px">ID Member auto</div>
          <div style="float:left;width:250px"><asp:TextBox ID="TextBoxNewCreatDate" runat="server" ValidationGroup="A" style="float:left;width:230px;float: left;border-top-left-radius: 3px;border-top-right-radius: 3px;border-bottom-right-radius: 3px;border-bottom-left-radius: 3px;border: 1px solid #ABADB3;resize: none;padding: 5px;color: #929292;"></asp:TextBox></div>
          <div style="float:left;width:300px;height: 150px;"><asp:TextBox ID="TextBoxNewName" ValidationGroup="A"  TextMode="MultiLine" runat="server" style="margin: 2px;width: 270px;height: 150px;float: left;border-top-left-radius: 3px;border-top-right-radius: 3px;border-bottom-right-radius: 3px;border-bottom-left-radius: 3px;border: 1px solid #ABADB3;resize: none;padding: 5px;color: #929292;"></asp:TextBox></div>
       <div style="float:left;width:250px"><asp:TextBox ID="TextBoxNewCityName" runat="server" ValidationGroup="A" style="float:left;width:230px;float: left;border-top-left-radius: 3px;border-top-right-radius: 3px;border-bottom-right-radius: 3px;border-bottom-left-radius: 3px;border: 1px solid #ABADB3;resize: none;padding: 5px;color: #929292;"></asp:TextBox></div>
           <div style="float:left;width:250px"><asp:TextBox ID="TextBoxNewAddress" runat="server" ValidationGroup="A" style="float:left;width:230px;float: left;border-top-left-radius: 3px;border-top-right-radius: 3px;border-bottom-right-radius: 3px;border-bottom-left-radius: 3px;border: 1px solid #ABADB3;resize: none;padding: 5px;color: #929292;"></asp:TextBox></div>
           <div style="float:left;width:250px"><asp:TextBox ID="TextBoxNewNote" runat="server" ValidationGroup="A" style="float:left;width:230px;float: left;border-top-left-radius: 3px;border-top-right-radius: 3px;border-bottom-right-radius: 3px;border-bottom-left-radius: 3px;border: 1px solid #ABADB3;resize: none;padding: 5px;color: #929292;"></asp:TextBox></div>
           <div style="float:left;width:250px"><asp:TextBox ID="TextBoxNewPassword" runat="server" ValidationGroup="A" style="float:left;width:230px;float: left;border-top-left-radius: 3px;border-top-right-radius: 3px;border-bottom-right-radius: 3px;border-bottom-left-radius: 3px;border: 1px solid #ABADB3;resize: none;padding: 5px;color: #929292;"></asp:TextBox></div>
           <div style="float:left;width:250px"><asp:TextBox ID="TextBoxNewLevelMemberID" runat="server" ValidationGroup="A" style="float:left;width:230px;float: left;border-top-left-radius: 3px;border-top-right-radius: 3px;border-bottom-right-radius: 3px;border-bottom-left-radius: 3px;border: 1px solid #ABADB3;resize: none;padding: 5px;color: #929292;"></asp:TextBox></div>
           <div style="float:left;width:250px"><asp:TextBox ID="TextBoxNewCountryID" runat="server" ValidationGroup="A" style="float:left;width:230px;float: left;border-top-left-radius: 3px;border-top-right-radius: 3px;border-bottom-right-radius: 3px;border-bottom-left-radius: 3px;border: 1px solid #ABADB3;resize: none;padding: 5px;color: #929292;"></asp:TextBox></div>
           <div style="float:left;width:250px"><asp:TextBox ID="TextBoxNewisRealPeople" runat="server" ValidationGroup="A" style="float:left;width:230px;float: left;border-top-left-radius: 3px;border-top-right-radius: 3px;border-bottom-right-radius: 3px;border-bottom-left-radius: 3px;border: 1px solid #ABADB3;resize: none;padding: 5px;color: #929292;"></asp:TextBox></div>
     
      </div>
   


 </div>        
   
   <asp:RequiredFieldValidator ID="RequiredFieldValidator2" runat="server" ControlToValidate="TextBoxNewMember" ErrorMessage="*" ValidationGroup="A"></asp:RequiredFieldValidator>
</asp:View>

</asp:MultiView>

</div>
           
</ContentTemplate>

<Triggers>
     
      <asp:AsyncPostBackTrigger ControlID="ButtonNewCancel" EventName="Click" />
      <asp:AsyncPostBackTrigger ControlID="ButtonNew" EventName="Click" />
      <asp:AsyncPostBackTrigger ControlID="LinkButtonCancelDelete" EventName="Click"  />
      <asp:AsyncPostBackTrigger ControlID="LinkButtonCancelDelete" EventName="Click" />
      <asp:AsyncPostBackTrigger ControlID="LinkButtonConfirmDelete" EventName="Click" />
      <asp:AsyncPostBackTrigger ControlID="LinkButtonMemberUpdate" EventName="Click" />
      <asp:AsyncPostBackTrigger ControlID="LinkButtonMemberCancel" EventName="Click" />
 
      <asp:AsyncPostBackTrigger ControlID="LinkButtonNewMember" EventName="Click" />
      <asp:AsyncPostBackTrigger ControlID="Go" EventName="Click" />
      <asp:AsyncPostBackTrigger ControlID="TextBoxFilterID" EventName="TextChanged" />
      <asp:AsyncPostBackTrigger ControlID="TextBoxFilterName" EventName="TextChanged" />
      <asp:AsyncPostBackTrigger ControlID="TextBoxFilterCityName" EventName="TextChanged" />
 </Triggers>

</asp:UpdatePanel>
وهذا الكود الداخلي

كود :
Imports System.Data
Imports System.Web.UI.WebControls
Imports System.Web.UI

Partial Class CTRL_MemberFilter
   Inherits System.Web.UI.UserControl

   Dim lblMsg As Object
   Dim MultiViewMember As Object
   Dim TextBoxFilterID As Object
   Dim lblMemberDeleteID As Object
   Dim TextBoxNewCityName As Object
   Dim TextBoxNewCityID As Object
   Dim TextBoxNewName As Object
   Dim LabelNameDelete As Object
   Dim repeaterMember As Object
   Dim ViewAdd As Object
   Dim TextBoxFilterName As Object
   Dim TextBoxFilterCityID As Object

   Protected Sub Page_Load(sender As Object, e As EventArgs) Handles Me.Load
       GetData()


       If Session("Msg") = 1 Then
           lblMsg.Text = "canceled delete"
           lblMsg.Attributes.CssStyle("display") = "block"
       ElseIf Session("Msg") = 2 Then
           lblMsg.Text = "deleted record"
           lblMsg.Attributes.CssStyle("display") = "block"
       ElseIf Session("Msg") = 3 Then
           lblMsg.Text = "canceled update"
           lblMsg.Attributes.CssStyle("display") = "block"
       ElseIf Session("Msg") = 4 Then
           lblMsg.Text = "updated record"
           lblMsg.Attributes.CssStyle("display") = "block"
       ElseIf Session("Msg") = 5 Then
           lblMsg.Text = "added new Member"
           lblMsg.Attributes.CssStyle("display") = "block"
       ElseIf Session("Msg") = 6 Then
           lblMsg.Text = "Canceled Add Member"
           lblMsg.Attributes.CssStyle("display") = "block"
       Else
           lblMsg.Text = ""
           lblMsg.Attributes.CssStyle("display") = "none"
       End If

       Session("Msg") = Nothing

       MultiViewMember.SetActiveView(ViewAll)

   End Sub

   Protected Sub GO_Click(sender As Object, e As EventArgs) Handles GO.Click
       GetData()
   End Sub

   Public Sub GetData()

       Dim objMemberFilter As New DB_Member
       objMemberFilter.ProID = Val(TextBoxFilterID.Text)
       objMemberFilter.ProName = TextBoxFilterName.Text
       objMemberFilter.ProCityID = TextBoxFilterCityID.Text

       Dim dt As DataTable = objMemberFilter.Find()
       repeaterMember.DataSource = dt
       repeaterMember.DataBind()

   End Sub

   Protected Function GetCssName(ByVal container As Object) As String
       If container IsNot Nothing Then
           If container.[GetType]() = GetType(RepeaterItem) Then
               If (DirectCast(container, RepeaterItem).ItemIndex Mod 2) = 0 Then
                   Return "odd"
               Else
                   Return "even"
               End If
           End If
       End If
       Return Nothing
   End Function

   Protected Sub repeaterMember_ItemCommand(source As Object, e As RepeaterCommandEventArgs) Handles repeaterMember.ItemCommand

       If e.CommandName = "Update" Then
           ' lblMemberUpdateID.Text = e.CommandArgument
           MultiViewMember.ActiveViewIndex = 1

       ElseIf e.CommandName = "Delete" Then
           lblMemberDeleteID.Text = e.CommandArgument
           MultiViewMember.ActiveViewIndex = 2
       Else
           MultiViewMember.ActiveViewIndex = 0
       End If

   End Sub

   Protected Sub repeaterMember_ItemDataBound(ByVal sender As Object, ByVal e As RepeaterItemEventArgs) Handles repeaterMember.ItemDataBound
       If repeaterMember.Items.Count < 1 Then
           If e.Item.ItemType = ListItemType.Footer Then
               Dim lblErrorMsg As Label = CType(e.Item.FindControl("lblErrorMsg"), Label)
               lblErrorMsg.Visible = True
           End If
       End If
   End Sub

   Protected Sub ButtonNew_Click(sender As Object, e As EventArgs) Handles ButtonNew.Click

       Dim objSt As New DB_Member
       objSt.ProName = TextBoxNewName.Text
       objSt.ProCityID = TextBoxNewCityID.Text
       objSt.add()
       Session("Msg") = 5
       GetData()
       ' Response.Redirect("~/CnPn/Pages/test.aspx")
       MultiViewMember.SetActiveView(ViewAll)
   End Sub

   'Protected Sub ViewUpdate_Activate(sender As Object, e As EventArgs) Handles ViewUpdate.Activate
   '    Dim objS As New DB_Member
   '    objS.ProID = lblMemberUpdateID.Text
   '    Dim dt As DataTable = objS.Find()
   '    TextBoxNameUpdate.Text = dt.Rows.Item(0).Item("Name").ToString
   '    TextBoxCityNameUpdate.Text = dt.Rows.Item(0).Item("CityName").ToString
   '    TextBoxCreateDateUpdate.Text = dt.Rows.Item(0).Item("CreateDate").ToString

   'End Sub

   ' Protected Sub LinkButtonMemberUpdate_Click(sender As Object, e As EventArgs) Handles LinkButtonMemberUpdate.Click
   'Dim objSt As New DB_Member
   ' objSt.ProID = lblMemberUpdateID.Text
   '  objSt.ProName = TextBoxNameUpdate.Text
   ' objSt.ProCityName = TextBoxCityNameUpdate.Text
   '    objSt.update()
   '   Session("Msg") = 4
   '   GetData()
   'Response.Redirect("~/CnPn/Pages/test.aspx")

   '   MultiViewMember.SetActiveView(ViewAll)
   'End Sub

   'Protected Sub LinkButtonLevelTrainerCancel_Click(sender As Object, e As EventArgs) Handles LinkButtonMemberCancel.Click
   '  Session("Msg") = 3

   '   MultiViewMember.SetActiveView(ViewAll)
   ' Response.Redirect("~/CnPn/Pages/test.aspx")
   '  End Sub

   Protected Sub ViewDelete_Activate(sender As Object, e As EventArgs) Handles ViewDelete.Activate
       Dim objS1 As New DB_Member
       objS1.ProID = lblMemberDeleteID.Text
       Dim dt As DataTable = objS1.Find()
       LabelNameDelete.Text = dt.Rows.Item(0).Item("Name").ToString

   End Sub

   Protected Sub LinkButtonConfirmDelete_Click(sender As Object, e As EventArgs) Handles LinkButtonConfirmDelete.Click
       Dim objSta As New DB_Member
       objSta.ProID = lblMemberDeleteID.Text
       objSta.delete()
       GetData()
       Session("Msg") = 2

       MultiViewMember.SetActiveView(ViewAll)
       '  Response.Redirect("~/CnPn/Pages/test.aspx")
   End Sub

   Protected Sub ButtonNewCancel_Click(sender As Object, e As EventArgs) Handles ButtonNewCancel.Click
       Session("Msg") = 6
       MultiViewMember.SetActiveView(ViewAll)
   End Sub

   Protected Sub LinkButtonCancelDelete_Click(sender As Object, e As EventArgs) Handles LinkButtonCancelDelete.Click
       Session("Msg") = 1
       ' Response.Redirect("~/CnPn/Pages/test.aspx")
       MultiViewMember.SetActiveView(ViewAll)
   End Sub

   Protected Sub LinkButtonNewLevelTrainer_Click(sender As Object, e As EventArgs) Handles LinkButtonNewMember.Click
       TextBoxNewName.Text = ""
       TextBoxNewCityName.Text = ""
       MultiViewMember.SetActiveView(ViewAdd)
   End Sub

   Protected Sub ViewAdd_Activate(sender As Object, e As EventArgs) Handles ViewAdd.Activate
       TextBoxNewName.Text = ""
       TextBoxNewCityName.Text = ""

   End Sub

   Private Function ViewAll() As Object
       Throw New NotImplementedException
   End Function

End Class

وأريد عرضها في صفحة خاصة بالأعضاء وفلترة كافة المعلومات


أرجوكم من لديه الفكرة في هذا فلا يبخل علي بذلك وبارك الله فيكم


الملفات المرفقة
.rar   WebSite.rar (الحجم : 344.8 ك ب / التحميلات : 5)
الرد }}}}
تم الشكر بواسطة:
#2
عرفت الكود كان هناك بعض الأخطاء .. 

أرجو اغلاق الموضوع بارك الله فيكم
الرد }}}}
تم الشكر بواسطة: مبرمج بلا حدود , hassan


المواضيع المحتمل أن تكون متشابهة .
الموضوع : الكاتب الردود : المشاهدات : آخر رد
  كيف اقدر اسوي filter بواسطه listbox للبحث ب DataGridViwe غير متصلة بقاعدة بيانات moh61 1 354 04-10-15, 10:40 PM
آخر رد: moh61
  [VB.NET] كيف عمل filter ابراهيم مراد 20 2,140 22-03-14, 02:29 AM
آخر رد: ناجي إبراهيم
  طلب واستفسار عن طريقة عمل برنامج السيف 7 739 28-07-13, 01:15 AM
آخر رد: الشاكي لله
  طريقة عمل filter nounou 2 448 11-12-12, 07:18 PM
آخر رد: SaLoOoMX

التنقل السريع :


يقوم بقرائة الموضوع: بالاضافة الى ( 1 ) ضيف كريم