Learning Curve…

Archive for the ‘Asp.net’ Category

1. Vertical Scoll position at the bottom of screen

<script type=”text/javascript”>

    function init() {

      var scnWid, scnHei;

      scnWid = document.body.clientWidth;

      scnHei = document.body.clientHeight;

      self.scrollTo(scnWid, scnHei);

    }

    window.onload = init;

  </script>

2. Vertical Scroll position based on a control in the screen

    Below example set scroll position at the start of grid’s header

<script type=”text/javascript”>

    function init() {

      var scnWid, scnHei;

      scnWid = getElementPosition(‘gridName’).left;

      scnHei = getElementPosition(‘gridName’).top;

     self.scrollTo(scnWid, scnHei);

    }

    function getElementPosition(elemID) {

      var offsetTrail = document.getElementById(elemID);

      var offsetLeft = 0;

      var offsetTop = 0;

      while (offsetTrail) {

        offsetLeft += offsetTrail.offsetLeft;

        offsetTop += offsetTrail.offsetTop;

        offsetTrail = offsetTrail.offsetParent;

      }

      return { left: offsetLeft, top: offsetTop };

    }

    window.onload = init;

  </script>

Eval is one-way, read only databinding.

Bind is two-way, read/write databinding.

Namespace:-

using System.Web.Configuration;
using System.Net.Configuration;

Code:-

System.Configuration.Configuration config = System.Web.Configuration.WebConfigurationManager.OpenWebConiguration

(HttpContext.Current.Request.ApplicationPath);
System.Net.Configuration.MailSettingsSectionGroup settings = (System.Net.Configuration.MailSettingsSectionGroup)

config.GetSectionGroup(“system.net/mailSettings”);
string strfromMailID = settings.Smtp.From;

Happy Coding!!!

Lets say , you have added a class with a different namespace folder or project  and then calling this class in your aspx.cs page where you have not added class’s namespace.Notice how you immediately get an error when you type class name because it’s defined in a namespace that is not in scope. You can fix the proble in two ways.

1. You can type Imports class’s namespace if you’re using VB.NET or using class’s namespace; if you’re using C# at the top of the code file.

2.You can click the word class name in your calling page once and then press Ctrl+. (Ctrl+Dot) to bring up a dialog that lets you choose the fix for the problem. Choose the appropriate item and .net will adds the necessary Imports/using statement for you.

A very good and detailed article on  WebProfile Builder and WAP for VS2010 can be found on :-

WebProfile Builder and WAP

In ASP.NET 4 FormView and on a few of the Login controls having RenderOuterTable property . When you set this property to True (it defaults to False so you need to set it explicitly) the control doesn’t generate a wrapping HTML <table> element. This in turn results in less code and cleaner HTML.

In ASP.NET 4, list controls have been extended with a ClientIDRowSuffix property that enables you to indicate the column whose value is used to create unique client-side IDs based on data in the database. For this to work, you need to set the ClientIDMode property.


Learning days (Calendar)

August 2017
M T W T F S S
« Jun    
 123456
78910111213
14151617181920
21222324252627
28293031  

Knowledge Bank (Archives)

I am on Twitter

Blog Stats

  • 504,344 hits

Enter your email address to subscribe to this blog and receive notifications of new posts by email.

Join 43 other followers

%d bloggers like this: