We help IT Professionals succeed at work.

asp.net / ajax / c#

Webboy2008
Webboy2008 asked
on
I recently added ajax script manager / update panel into the masterpage.
it is working fine but when I tried to click on some controls on ascx file
like radio button and etc. It alerts me:
error executing child request for webpage.aspx

and I can't even select radio button.
how to fix it?
Comment
Watch Question

GlobaLevelProgrammer

Commented:
masterpages to my knowledge are not meant for controls...but for layout....i would keep the controls and ajax controls in .aspx pages...
SAMIR BHOGAYTATeam Lead
CERTIFIED EXPERT

Commented:
Hello, when you use the masterpage at that time you have to use the trigger for update panel and set the controlid = submit/save button. It is working.
Amro OsamaDevelopment, GIS Consultant - Haram Presidency
CERTIFIED EXPERT

Commented:
try to put an Updatepanel inside the Control itself, and let it do the Update.

Author

Commented:
OHDev2004: Example please. I don't know what you mean
Amro OsamaDevelopment, GIS Consultant - Haram Presidency
CERTIFIED EXPERT

Commented:
I mean add an Updatepanel inside the Control, and put all the contents inside it.
this will let this updatepanel handle Updates, inplace of the Updatepanel that resides in the Masterpage.


<%@ Control Language="C#" AutoEventWireup="true" CodeFile="Control1.ascx.cs"
    Inherits="Control1" %>

    <asp:UpdatePanel ID="UpdatePanel1" runat="server" >
        <ContentTemplate>
             <%--controls and contents inside the controls go here.--%>

        </ContentTemplate>
    </asp:UpdatePanel>

Open in new window

Author

Commented:
that is what i done. but i still see the alert message when radiobutton is clicked.

Author

Commented:
And the radiobutton itself has postback = true
Amro OsamaDevelopment, GIS Consultant - Haram Presidency
CERTIFIED EXPERT

Commented:
1- use the Ajax ToolkitScriptManager instead of the regular asp ScriptManager

2- I always try to avoid using an updatepanel for all the website, ie putting the ContentPlaceHolder inside of the Updatepanel.
if you really need an updatepanel in the masterpage for some contents related to it, then just keep the ContentPlaceHolder out if it, and use updatepanels for each page or control when needed.

Author

Commented:
Item 1 - I understood.

Item 2 - I don't understand. If I don't add updatepanel in the masterpage.
can you suggest what I should do and send me example? I prefer the best solution.
Amro OsamaDevelopment, GIS Consultant - Haram Presidency
CERTIFIED EXPERT

Commented:
did item 1 do any difference?

item 2:
what i mean is instead of using one UpdatePanel for the whoe website, that is putting an updatepanel in the masterpage to let the children webpages use it.
instead of that remove that updatepanel, and let each page/control have its own updatepanel.

Author

Commented:
Item 2: why?
Development, GIS Consultant - Haram Presidency
CERTIFIED EXPERT
Commented:
sorry, i've read somewhere that it was not recommended, but i don't remember where at the moment.
and i faced my self similar problems like the one you are facing now.

you could of course have an UpdatePanel inside the Masterpage but for use inside it only, away from the Child pages, ie keep it away of the ContentPlaceHolder.
Amro OsamaDevelopment, GIS Consultant - Haram Presidency
CERTIFIED EXPERT

Commented:
glad i could help, so was it Item 1 or Two? :)

Explore More ContentExplore courses, solutions, and other research materials related to this topic.