- Through inheritance we can eliminate the redundant code and extend the user of the existing classes.
- We can build program from the standard working modules that can communicate with the one another rather then having start writing code from beginning.
- It is possible to have multiple instances of objects of class without any interface.
- It is easy to partion the work.
- Object oriented system can be easily upgraded from the small to the large systems.
- Easily modifying and extending implementations of components without having to recode everything from scratch.
Object Oriented Interview Question Part 1- Benefits Of Inheritance
Happy New Year 2009
I am jalpesh vadgama wishing you a very happy and healthy new year ahead. Sorry i was busy with my projects so not able to post anything related to dot net. Now i am back with the all the things and promise to be regular post. If you want to listen anything from me then please post comment.
Last year was hectic to me as lots of things are going on now my house is also shifted and i have broadband connection at my home. We can have conservation regularly.
How to add service reference dynamically from user control? Microsoft Ajax
First, Create a web page default.aspx and put the html code as following..
---------------------------------------------------------------------------
<asp:ScriptManager ID="MainScriptManager" runat="server">
</asp:ScriptManager>
--------------------------------------------------------------------------
Now, Create a usercontrol my first user control
Create a function called AddScriptReference as following...
'--------------------------------------------------------------------------
private void AddScriptReference()
{
ScriptManager scriptManger = ScriptManager.GetCurrent(this.Page);
if (scriptManger != null)
{
ServiceReference serviceReference = new ServiceReference();
serviceReference.Path="~/MyWebService.asmx";
serviceReference.InlineScript = false;
scriptManger.Services.Add(serviceReference);
}
else
{
throw new Exception("Script Manager Not Found");
}
}
'--------------------------------------------------------------------------
Then override controls init event as following...
'--------------------------------------------------------------------------
protected override void OnInit(EventArgs e)
{
AddScriptReference();
base.OnInit(e);
}
'--------------------------------------------------------------------------