I have a user control, which cotains a scriptmanager and updatepanel. Inside the update panel I have a calendar control and a textbox. On selectionchange event of the calendar contol, i store the claendar value into the the text box. it work fine.
but when i try to drag this user control more than once on my page, it gives me an error that only once instance of the script manager can be used. I understand this? and the soultion is to use scriptmanagerproxy? but how, i need an example or some url that
can help me with this.
You can Add an scriptmanagerproxy to your user control the same way as you add you scriptmanager control. The scriptmanagerproxy reacts the same way the scriptmanager. You have to add the scriptmanager to your webpage and the scriptmanagerproxy to your user
control and your done!
well~, you don't really need to add a scriptmanagerproxy to your control. you just need to put the scriptmanager on the page (or master page) and then just drop the updatepanel on your user control. that should work without any problems...
--
Regards,
Luis Abreu
email: labreu_at_gmail.com
EN blog:http://msmvps.com/blogs/luisabreu
In my case it little different. Its not exactly the same as the first post. I dont have UpdatePanel. All i need to make textbox work with Ajax in userControl which get called from Default.aspx page. My scriptManager is already declared in in the master page.
Thanx for the reply....I can explain more in detail as:
I m trying to use CalendarExtender in my ascx file. The issue is i cant declare ScriptManager on this page since this get called many times based on number of rows returned and u cant add more than one ScriptManager in a page.
For this i added, the ScriptManager in the Master page. But i dont know how to use it in ascx after declaring it into the master page.
I am able to use to it in Default.aspx page using MasterPageFile ="~/MainMaster.master" ; but in ascx file, i cant declare this directive. I used Reference i.e.
<%@ Reference VirtualPath="~/Mainmaster.master" %> ; but no use.
The structure is of calling is ::
MasterPage --> Default.aspx --> Detail.ascx
I can use ajax upto Default.aspx but including file in Default.aspx but cant do anything in Detail.ascx file
but why would you want to get a reference to the scriptmanager control on your user control? if it's on the master and the master was applied to the page that has the user control then you don't need to do anything else.
--
Regards,
Luis Abreu
email: labreu_at_gmail.com
EN blog:http://msmvps.com/blogs/luisabreu
ok, please build a small demo page that shows this. you'll need a master, a user control and a page that uses that control. post it here and i'll take a look, ok?
--
Regards,
Luis Abreu
email: labreu_at_gmail.com
EN blog:http://msmvps.com/blogs/luisabreu
FutureGuru
Member
57 Points
82 Posts
Usercontrol and scriptmanagerproxy - need help
Jan 03, 2007 07:28 PM|LINK
I have a user control, which cotains a scriptmanager and updatepanel. Inside the update panel I have a calendar control and a textbox. On selectionchange event of the calendar contol, i store the claendar value into the the text box. it work fine.
but when i try to drag this user control more than once on my page, it gives me an error that only once instance of the script manager can be used. I understand this? and the soultion is to use scriptmanagerproxy? but how, i need an example or some url that can help me with this.
thanks in advance.
Dennis van d...
Participant
1129 Points
335 Posts
Re: Usercontrol and scriptmanagerproxy - need help
Jan 03, 2007 08:22 PM|LINK
Hi FutureGuru,
You can Add an scriptmanagerproxy to your user control the same way as you add you scriptmanager control. The scriptmanagerproxy reacts the same way the scriptmanager. You have to add the scriptmanager to your webpage and the scriptmanagerproxy to your user control and your done!
Regards,
http://dennisv.net/
Don't forget to mark the most helpful reply/replies as Answer.
saqib_dotnet
Member
298 Points
650 Posts
Re: Usercontrol and scriptmanagerproxy - need help
Nov 07, 2007 07:55 PM|LINK
Hi Dennis
I have same problem and i did like you said in above thread, but no difference. Is there something i m still missing?
Regards
Luis Abreu
All-Star
25674 Points
5369 Posts
MVP
Re: Usercontrol and scriptmanagerproxy - need help
Nov 07, 2007 07:58 PM|LINK
hello.
well~, you don't really need to add a scriptmanagerproxy to your control. you just need to put the scriptmanager on the page (or master page) and then just drop the updatepanel on your user control. that should work without any problems...
Regards,
Luis Abreu
email: labreu_at_gmail.com
EN blog:http://msmvps.com/blogs/luisabreu
saqib_dotnet
Member
298 Points
650 Posts
Re: Usercontrol and scriptmanagerproxy - need help
Nov 08, 2007 12:23 AM|LINK
Hi Luis
In my case it little different. Its not exactly the same as the first post. I dont have UpdatePanel. All i need to make textbox work with Ajax in userControl which get called from Default.aspx page. My scriptManager is already declared in in the master page.
Any ideas.
Regards
Luis Abreu
All-Star
25674 Points
5369 Posts
MVP
Re: Usercontrol and scriptmanagerproxy - need help
Nov 08, 2007 08:20 AM|LINK
hello.
can you give more info about this?
Regards,
Luis Abreu
email: labreu_at_gmail.com
EN blog:http://msmvps.com/blogs/luisabreu
saqib_dotnet
Member
298 Points
650 Posts
Re: Usercontrol and scriptmanagerproxy - need help
Nov 08, 2007 02:51 PM|LINK
Thanx for the reply....I can explain more in detail as:
I m trying to use CalendarExtender in my ascx file. The issue is i cant declare ScriptManager on this page since this get called many times based on number of rows returned and u cant add more than one ScriptManager in a page.
For this i added, the ScriptManager in the Master page. But i dont know how to use it in ascx after declaring it into the master page.
I am able to use to it in Default.aspx page using MasterPageFile ="~/MainMaster.master" ; but in ascx file, i cant declare this directive. I used Reference i.e.
<%@ Reference VirtualPath="~/Mainmaster.master" %> ; but no use.
The structure is of calling is ::
MasterPage --> Default.aspx --> Detail.ascx
I can use ajax upto Default.aspx but including file in Default.aspx but cant do anything in Detail.ascx file
Any ideas.
Regards
Luis Abreu
All-Star
25674 Points
5369 Posts
MVP
Re: Usercontrol and scriptmanagerproxy - need help
Nov 08, 2007 07:00 PM|LINK
hello again.
but why would you want to get a reference to the scriptmanager control on your user control? if it's on the master and the master was applied to the page that has the user control then you don't need to do anything else.
Regards,
Luis Abreu
email: labreu_at_gmail.com
EN blog:http://msmvps.com/blogs/luisabreu
saqib_dotnet
Member
298 Points
650 Posts
Re: Usercontrol and scriptmanagerproxy - need help
Nov 08, 2007 07:29 PM|LINK
My default is on master. My child which is user web control is at the end is called by default. So basically master was applied to the default page.
If i m doing something wrong, let me know that....My problem as u know is that ajax is not wroking in the chold control
Luis Abreu
All-Star
25674 Points
5369 Posts
MVP
Re: Usercontrol and scriptmanagerproxy - need help
Nov 08, 2007 07:32 PM|LINK
hello again.
ok, please build a small demo page that shows this. you'll need a master, a user control and a page that uses that control. post it here and i'll take a look, ok?
Regards,
Luis Abreu
email: labreu_at_gmail.com
EN blog:http://msmvps.com/blogs/luisabreu