Skip to content
Loading
+1
  • Mohsin Arif
    +1
    welcome my pleasure..
    +1
  • +1
    Hi Priyanka,
     
    When you are using lazy loading at that time every time you need to first load complete object.
     
    if result datatype is IsEnumarator or IQueryable you need to use result .Count() ;
     
    if result datatype is List then you can use result.Count;
     
    you must try this..
     
    if (result.Count() > 0)
    +1
  • Mohsin Arif
    0
    which you Use VS ?
    0
  • Mohsin Arif
    0
    you are doing fine there is no issue in your code Count is property and also a method . but why this error is occured on your side i cant understand. while your same code i run but i haven't got any error
    0
  • Priyanka Singh
    0
    Hey
    Mohsin Arif
     
    I use Visual studio 2010 it shows error in my program.
    0
  • Priyanka Singh
    0
    On Selection of dropdownlist "ddlUser_SelectedIndexChanged" does not work.
    0
  • Mohsin Arif
    0
    please confirm me is there fire the event of ddlUser_SelectedIndexChanged 
     
    put the breakpoint and check otherwise send me html side code. 
    0
  • Priyanka Singh
    0
    1. <%@ Page Language="C#" AutoEventWireup="true" CodeBehind="Entity_Extract_Data.aspx.cs"  
    2.     Inherits="GRIDOPERATION.Model.Entity_Extract_Data" %>  
    3.   
    4. >  
    5. <html xmlns="http://www.w3.org/1999/xhtml">  
    6. <head runat="server">  
    7.     <title>title>  
    8. head>  
    9. <body>  
    10.     <form id="form1" runat="server">  
    11.     <div>  
    12.         <asp:DropDownList ID="ddlUser" runat="server" AppendDataBoundItems="true"   
    13.             onselectedindexchanged="ddlUser_SelectedIndexChanged">  
    14.           <asp:ListItem Selected="True" Text=" Select a Company Name" Value="0">asp:ListItem>  
    15.         asp:DropDownList>  
    16.         <br />  
    17.         Company Name:  
    18.         <br />  
    19.         <asp:TextBox ID="tbCompanyName" runat="server" />  
    20.         <br />  
    21.         Contact Name:  
    22.         <br />  
    23.         <asp:TextBox ID="tbContactName" runat="server" />  
    24.         <br />  
    25.         Contact Title:  
    26.         <br />  
    27.         <asp:TextBox ID="tbContactTitle" runat="server" />  
    28.         <br />  
    29.         Address:  
    30.         <br />  
    31.         <asp:TextBox ID="tbAddress" runat="server" />  
    32.         <br />  
    33.         City:  
    34.         <br />  
    35.         <asp:TextBox ID="tbCity" runat="server" />  
    36.     div>  
    37.     form>  
    38. body>  
    39. html>  
    I have applied the breakpoint in
    1. protected void ddlUser_SelectedIndexChanged(object sender, EventArgs e)  
    2. {  
    3. PopulateFormFields(Convert.ToInt32(ddlUser.SelectedItem.Value));  
    4. }  
    but on selection of any of the value in dropdown list,it doesn't goes on the ddlUser_SelectedIndexChanged.I dont know why,that's why I think value not displayed in textbox because it failed to called the method "PopulateFormFields".Please Tell me what to do next.
    0
  • Mohsin Arif
    0
    hey where is ddluser in html side. so how can it fire...
    0
  • Mohsin Arif
    0
    1. <%@ Page Title="" Language="C#" MasterPageFile="~/Site.Master" AutoEventWireup="true" CodeBehind="Entity_Model.aspx.cs" Inherits="GRIDOPERATION.Model.Entity_Model" %>    
    2. "Content1" ContentPlaceHolderID="HeadContent" runat="server">    
    3.     
    4. "Content2" ContentPlaceHolderID="MainContent" runat="server">    
    5.  

      Add New

            
    6.           
    7.     
    8.       
    9.             
    10.       
    11.             
    12.       
    13.         
    14.       
    15.         
    16.       
    17.             
    18.       
    19.             
    20.       
    21.         
    22.       
    23.         
    24.       
    25.             
    26.       
    27.             
    28.       
    29.         
    30.       
    31.         
    32.       
    33.             
    34.       
    35.             
    36.       
    37.         
    38.       
    39.         
    40.       
    41.             
    42.       
    43.             
    44.       
    45.         
    46.       
    47.         
    48.       
    49.             
    50.       
    51.             
    52.       
    53.         
    54.       
    55.     
    56. Customer ID"tbCustomerId" runat="server" />
      Company Name"tbCompanyName" runat="server" />
      Contact Name"tbContactName" runat="server" />
      Contact Title"tbContactTitle" runat="server" />
      Address"tbAddress" runat="server" />
      City"tbCity" runat="server"/>
            
    57.           
    58.     "lblMessage" runat="server" />      
    59.           
    60.     "btnAdd" runat="server" Text="Add" onclick="btnAdd_Click" />      
    61.   
    there is no any ddluser so where it displayed and how???
    0
  • Priyanka Singh
    0
    Mohsin Arif 
     
    Please Check I made the correction earlier I upload some other file.
    0
  • Priyanka Singh
    0
    Mohsin Arif
     
    Thank you so much now it worked.
    0