The Controls collection cannot be modified because the control contains code blocks(i.e. )


Introduction: In this post i am going to reason two things: (1)why error “The Controls collection cannot be modified because the control    contains code blocks (i.e. <% … %>) ” come. (2)How to solve same Cause of error When you add any AJAX extenders to your Web pages of your web application or try to … Continue reading The Controls collection cannot be modified because the control contains code blocks(i.e. )

Rebinding events in jQuery after Ajax update (updatepanel)


Some time we use update panel and $(document).ready(function() {});function of jquery in same page . Then whatever written inside $(document).ready(function() {});not work once we have done or performed partail post back because script inside $(document).ready(function() {}); is not bound with the page .So in this Scenario we have two option for solving the problem for … Continue reading Rebinding events in jQuery after Ajax update (updatepanel)

Sending email in asp.net


Sending email’s from web applications is a very common requirement in most projects irrespective of any language site is deveoped .This article explores how to send Emails in ASP.NET  with attachments with gmail account and using custome host address. Mail Sending using custome host address Sending Email Using Gmail In ASP.NET. if you don’t have … Continue reading Sending email in asp.net

Keep session alive as long as you want


Most of the time we face problem of session time out . for this there are number of  options are available to solve this like: Using Web.config file  <system.web>     <sessionState mode=”InProc” cookieless=”false” timeout=”15″>     </sessionState> </system.web>    Set session timeout in Global.asax void Session_Start(object sender, EventArgs e) {   // Code that runs when a new … Continue reading Keep session alive as long as you want

ASP.NET MVC Application Execution Process


Stage Details Receive first request for the application In the Global.asax file, Route objects are added to the  RouteTable object. Perform routing The UrlRoutingModule module uses the first matching Route object in the RouteTable collection to create the RouteData object, which it then uses to create a RequestContext object. Create MVC request handler The MvcRouteHandler … Continue reading ASP.NET MVC Application Execution Process

Request.ApplicationPath is not working


Sometime Request.ApplicationPath  does not work with all browser properly  , so use this.Request.Url.GetLeftPart(UriPartial.Authority) instead. Lets get it by example: If we use Request.ApplicationPath window.open(‘” + Request.ApplicationPath + “/Massimo/ProductDetails.aspx”‘); It will be rendered as http://Massimo/ProductDetails.aspx that i do not want If we use Request.Url.GetLeftPart(UriPartial.Authority) then it will be rendered as  http://ServerName/Massimo/ProductDetails.aspx that is what we want. … Continue reading Request.ApplicationPath is not working

ASP.Net menu control not working in Chrome & Safari Browsers


In  Solution Explorer right click your application and add the “ASP.Net Folder”App_Browsers if you don’t already have it. Add a New “Browser File” item to this special folder and call it safari.browser. Delete all default coding in this file and replace it with the following: <browsers> <browser refID=”safari1plus”> <controlAdapters> <adapter controlType=”System.Web.UI.WebControls.Menu” adapterType=”” /> </controlAdapters> </browser> </browsers> … Continue reading ASP.Net menu control not working in Chrome & Safari Browsers

ASP.NET MVC: Razor’s Parsing Algorithm for Code Nuggets


In ASP.NET MVC , there is view engine called Razor that is very easy compared to ASPX view engine . it allow you to code within aspx html fully utilizing your C# and VB.net skill , more details of its uses syntax. you can follow this link of Scott Guthrie  http://weblogs.asp.net/scottgu/archive/2011/05/12/asp-net-mvc-3-and-the-helper-syntax-within-razor.aspx The below algorithm captures the … Continue reading ASP.NET MVC: Razor’s Parsing Algorithm for Code Nuggets