Posts

Showing posts from May, 2013

Data Bound Controls in ASP.Net - Part 2 (DataList control)

Image
The  DataList  Web server control displays rows of database information in customized format. These two controls play an important role in ASP.NET. They represent many common features. Here is a sample code for DataList. we see this code in detail later on. ASP.Net Page Code: <div>         <h2 style="color: Green">             DataList in ASP.NET using C#</h2>         <asp:DataList ID="DataList1" runat="server" CssClass="Grid" DataSourceID="SqlDataSource1"                  GridLines="Both" RepeatColumns ="3" RepeatDirection ="Horizontal" RepeatLayout ="Table">                          <HeaderStyle  ForeColor="White" CssClass="HeaderStyle"/>             <HeaderTemplate>                 Product Information             </HeaderTemplate>             <ItemStyle BackColor="#FFF7E7" ForeColor="#8

Data Bound Controls in ASP.Net - Part 1 (AdRotator & List Controls)

Image
In this artical, which is a part of series of articals about Data Bound Controls in ASP.Net, we will learn about Data Bound controls.  Data-bound Web server controls are controls that can be bound to a data source control to make it easy to display and modify data in your Web application.   Almost, all ASP.Net applications rely on data presentation from a back-end data source. Data bound controls have been an important part of intracting with data in dynamic ASP.Net application. In ASP.Net 2.0, significant improvement in data-bound controls were introduced, including a BaseDataBoundControl class and declarative syntax.  The BaseDataBoundControl acts as the base class for the DataBoundControl class and the HierarchicalDataBoundControl class. In this series of articals, we will learn about the following Data-Bound Controls: AdRotator List controls DataList GridView FormView DetailsView ListView TreeView Menu SiteMapPath DataGrid In the end of this series, we will see a

maxRequestLength And maxAllowedContentLength

maxRequestLength indicates the maximum request size supported by ASP.NET, whereas maxAllowedContentLength specifies the maximum length of content in a request supported by IIS. So we need to set both in order to upload large files: the smaller one takes priority. Setting for  maxRequestLength     <system.web>             <httpRuntime maxRequestLength="153600" executionTimeout="900" />   </system.web> Setting for  maxAllowedContentLength   <system.webServer>           <security>                  <requestFiltering>                            <requestLimits maxAllowedContentLength="157286400" />                  </requestFiltering>          </security>  </system.webServer> If the file (request) length ( say, 15MB ) is less than maxAllowedContentLength ( say, 30MB ) but more than maxRequestLength ( say, 10MB ), the user will get the standard ASPX error page, if server has one. I

Upload File Size in IIS 7+

Image
Today, i was programming to upload document files. When i wanted to upload a file having file size around 31mb, following error popped up: To avoid this error, i had applied some changes in web.config file. By default, IIS7 limits file upload to 30MB.  If the file size, you want to upload is larger than 30MB, it returns a 404 error. 30MB limit is set in IIS7, so we can change this limit. To change the value in IIS 7+, do the following steps: Open IIS Select Requests Filtering and open it by double clicking the icon.  Click on ‘Edit Request Filtering Services’ and below popup window will open. The default value of 30 MB (30000000) is shown. There is an alternate solution that can be enabled at the site level rather than server-wide. As shown below, i have increased the content lenth from 30 MB to 50 MB in web.config's <system.webServer> <system.webServer>         <security>             <requestFiltering>