Tutorials
Resources
Forum
Reviews
Communities
Interview
Jobs
Projects
Training
Your
Ad
Here
Silverlight Games
|
Mentor
|
Code Converter
|
Articles
|
Code Factory
|
Computer Jokes
|
Members
|
Peer Appraisal
|
IT Companies
|
Bookmarks
|
Polls
|
Revenue Sharing
|
Lobby
|
Gift Shop
|
Prizes & Awards
My Profile
Sign In
Register
AdSense Revenue
Active Members
Today
Nikhil Gaur
(70)
Shameer
(34)
Nadheera V
(30)
Last 7 Days
Nikhil Gaur
(621)
Anil Kumar ...
(582)
Abhisek Panda
(445)
more...
Resources
»
Articles
»
ASP.NET/Web Applications
»
How to add service reference dynamically from user control? Microsoft Ajax
Posted Date: 05 Dec 2008
Resource Type:
Articles
Category:
ASP.NET/Web Applications
Author:
DotNetJaps
Member Level:
Gold
Rating:
Points
: 4
First, Create a web page default.aspx and put the html code as following..
---------------------------------------------------------------------------
--------------------------------------------------------------------------
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);
}
'--------------------------------------------------------------------------
For more details, visit
http://jalpesh.blogspot.com/
Responses
Author:
ChandraShekar Thota
03 Jan 2009
Member Level:
Diamond
Points
: 0
Good
Chandrashekar Thota(Editor, MVP)
Feedbacks
Popular Tags
What are tags ?
Search Tags
Sign In
to add tags.
How to add service reference dynamically from user control? Microsoft Ajax
.
Post Feedback
This is a strictly moderated forum. Only approved messages will appear in the site. Please use 'Spell Check' in Google toolbar before you submit.
You must
Sign In
to post a response.
Next Resource:
Adding Colored Items to Dropdown Using Javascript and Change Page Background
Previous Resource:
Handling concurrent AJAX requests
Return to Discussion Resource Index
Post New Resource
Category:
ASP.NET/Web Applications
Post resources and
earn money
!
Related Resources
Adding Colored Items to Dropdown Using Javascript and Change Page Background
Huge description of delegates
About Base Class Libraries
How to dynamically create controls using asp.net
AutoEventWireup property in asp.net
Exception Handling Mechanism
dotNet Slackers
About Us
Contact Us
Privacy Policy
Terms Of Use