Wednesday, October 31, 2012

Seo From master page in asp.net

PRODUCT.ASPX

<!-- Replace lblProductTitle with the name of the variable that contains your product title.
Make sure the value is set in the code behind page. -->

<head runat="server">
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title><%=lblProductTitle.Text%> &raquo; Test.com</title>
<meta name="description" content="Get widgets: low prices and free 
shipping at Test.com" runat="server" id="description" />

PRODUCT.ASPX.VB

'Make sure this import statement appears at the top of the page.
Imports System.Web.UI.HtmlControls



'Put this code in DataBind() or some other subroutine that runs on page load. 
'Replace lblProductTitle with the variable containing your product title.

description.Attributes("content") = " Get widgets: low prices and free shipping at 
Test.com. " & lblProductTitle.Text & "available for less."

Increase ASP.NET page timeout

 Increase timeout of page by just adding following line
 in system.web of web.config
<httpRuntime executionTimeout="600" /> <!-value is in secs-->

Tuesday, October 30, 2012

Maximum Request Length Exceeded ASP.NET

If you get this error Maximum request length exceeded while i was trying to upload several files, or a single big size file. As default, max file upload size is 4MB.
We can easily have a solution by not touching our asp.net c# or VB source code.

Just add a single line of code in your Web.config file, and you are done.


<configuration>
  <system.web>
    <httpRuntime maxRequestLength="32768" />
  </system.web>
</configuration>