Tuesday, May 19, 2009

Access MasterPage ScriptManager from a Content Page

You probably know that each ASP.NET Ajax page MUST have ONLY ONE ScriptManager control.
No more, no less.

If you try to add more than one ScriptManager to ASP.NET page you will receive error:
"Only one instance of a ScriptManager can be added to the page."

Because of this, its common (and recommended) practice to use this approach:
Create MasterPage, and place ScriptManager control on it and then use this instance on each of ContentPages.

here is the code that you can place on your ContentPage to retrieve an instance of ScriptManager from MasterPage:


ScriptManager scriptManager = ScriptManager.GetCurrent(this.Page);

Tuesday, May 5, 2009

Highlight or BOLD a single item in a drop down list Asp.Net


Highlight or BOLD a single item in a drop down list in Html we can do using optgroup tag.


Coming to Asp.Net drop down we don't have any option like this.I found one control which can accomplish our task in Asp.Net.

You can get this from Click here