TECHNOLOGIES
FORUMS
JOBS
BOOKS
EVENTS
INTERVIEWS
Live
MORE
LEARN
Training
CAREER
MEMBERS
VIDEOS
NEWS
BLOGS
Sign Up
Login
No unread comment.
View All Comments
No unread message.
View All Messages
No unread notification.
View All Notifications
Answers
Post
An Article
A Blog
A News
A Video
An EBook
An Interview Question
Ask Question
Forums
Monthly Leaders
Forum guidelines
Manikandan LJ
NA
45
1.6k
Controls with in dynamicaly loaded user control update panel
Dec 12 2018 10:35 AM
Hi,
I am loading the user control dynamically by the use of update panel when user select the tab . User control contains a button as 'btnCreate'. When i am binding the asyncpostback trigger to the parent update panel. It is throwing error. It is not at all calling button click event.
Button click event is not getting register with update panel. Can any one do some help on this? Thanks in advance
Parent Page :
<
asp:UpdatePanel
ID
=
"updatePanelSearch"
runat
=
"server"
ChildrenAsTriggers
=
"true"
UpdateMode
=
"Conditional"
RenderMode
=
"Block"
>
<
ContentTemplate
>
<
div
class
=
"row"
>
<
ul
class
=
"nav nav-tabs tabs-center"
>
<
li
role
=
"presentation"
class
=
"active"
>
<
a
href
=
"javascript:;"
id
=
"tabAdvancedSearch"
data-child-id
=
"tabContentAdvancedSearch"
runat
=
"server"
onserverclick
=
"tabAdvancedSearch_ServerClick"
>
Advance Search
</
a
>
</
li
>
<
li
role
=
"presentation"
>
<
a
href
=
"javascript:;"
id
=
"tabSavedSearch"
runat
=
"server"
data-child-id
=
"tabContentSavedSearch"
onserverclick
=
"tabSavedSearch_ServerClick"
>
Saved Searches
</
a
>
</
li
>
</
ul
>
</
div
>
<
div
id
=
"tabContentAdvancedSearch"
class
=
"row tab-content"
>
<
asp:PlaceHolder
ID
=
"placeHolderAdvanceSearch"
runat
=
"server"
>
</
asp:PlaceHolder
>
</
div
>
<
div
id
=
"tabContentSavedSearch"
class
=
"row tab-content"
>
<
asp:PlaceHolder
ID
=
"placeHolderSavedSearch"
runat
=
"server"
>
</
asp:PlaceHolder
>
</
div
>
</
ContentTemplate
>
<
Triggers
>
<
asp:AsyncPostBackTrigger
ControlID
=
"tabSavedSearch"
/>
<
asp:AsyncPostBackTrigger
ControlID
=
"tabAdvancedSearch"
/>
</
Triggers
>
</
asp:UpdatePanel
>
User Control :
<
div
class
=
"saved-search-container"
>
<
div
class
=
"row"
>
<
input
id
=
"btnCreateSearch"
runat
=
"server"
class
=
"btn btn-primary pull-right"
onserverclick
=
"btnCreateSearch_ServerClick"
value
=
"Add"
type
=
"button"
/>
</
div
>
Parent page code behind:
protected
void
tabSavedSearch_ServerClick(
object
sender, EventArgs e)
{
placeHolderSavedSearch.Controls.Add(LoadControl(
"~/Shared/SavedSearch.ascx"
));
ScriptManager currPageScriptManager = ScriptManager.GetCurrent(
this
)
as
ScriptManager;
if
(currPageScriptManager !=
null
)
{
currPageScriptManager.RegisterAsyncPostBackControl(control);
updatePanelSearch.Update();
}
}
User control code behind :
protected
void
btnCreateSearch_ServerClick(
object
sender, EventArgs e)
{
CreateSearch(sender);
}
Reply
Answers (
0
)
Sharepoint Integration in asp.net core 2.0
How to Disbled true ajax cascading dropdown list After load