I have an UpdatePanel inside which there is a Datalist containing Labels,Hyperlinks,Images etc.
<asp:UpdatePanel runat="server" ID="updatepanel2" UpdateMode="Conditional" ChildrenAsTriggers="false" >
<ContentTemplate>
<div class="posts1" runat="server" id="postArea">
<asp:DataList ID="dlPosts" runat="server" CellPadding="3" CellSpacing="0" >
<ItemTemplate runat="server">
<div class="commentbox1">
<asp:Image ID="profileImage" runat="server" CssClass="image_icon" ImageUrl='<%# "~\\Profile_Pics\\"+ Eval("profile_pic") %>' />
<asp:Label ID="lblFriendName" CssClass="post_pic_name" runat="server" ForeColor="Black" Text='<%# Eval("user_to").ToString()==Eval("user_from").ToString()?Eval("user_from"):Eval("user_from") + " -> " +Eval("user_to") %>'></asp:Label>
<br />
<asp:LinkButton CommandArgument='<%# Eval("post_id") + "\\"+ Eval("post_pic") %>' runat="server" ID="viewComments" CssClass="view_post" Text="View Comments And Likes" OnClick="View_Post"></asp:LinkButton>
<br />
<asp:Label Autosize="false" Dock="fill" ID="Comment" CssClass="post_style" runat="server" ForeColor="Black" Text='<%# Eval("post") %>'></asp:Label>
<asp:ImageButton runat="server" CommandArgument='<%# Eval("post_id") + "\\" + Eval("post_pic") %>' OnCommand="DisplayEnlargedPic"
CssClass="post_pics" ID="post_picture" Visible='<%# Eval("post_pic").ToString()==""?false:true %>' ImageUrl='<%# "~\\Profile_Pics\\"+ Eval("post_pic") %>' />
<asp:LinkButton runat="server" ID="postLike" Text="Like" OnClick="ujwal"></asp:LinkButton>
<asp:Panel runat="server" id="PostComments" class="postcomments" visible="false"></asp:Panel>
</div>
</ItemTemplate>
</asp:DataList>
</div>
</ContentTemplate>
</asp:UpdatePanel>
On clicking ImageButton DisplayEnlargedPic is supposed to run which displays a div tag containing Enlarged Picture and Comments
The div tag is
<div runat="server" id="id05" class="w3-modal background" style="display:none;">
<div class="w3-modal-content center4">
<div class="w3-container">
<span onclick="document.getElementById('id05').style.display='none'" class="w3-closebtn w3-hover-red w3-container w3-padding-8 w3-display-topright" title="Close Modal">×</span>
<div runat="server" class="profilepicholder" id="Post_Pic_Location">
<asp:Image runat="server" ID="Enlarged_Post_pic" ImageUrl="profile1.png" CssClass="profilepic" />
<asp:LinkButton runat="server" Text="Comment" ID="Enter_Comment" OnClick="Enter_The_Comment1" CssClass="insertComment"></asp:LinkButton>
<asp:ImageButton runat="server" CssClass="like" OnClick="LikeImage" ID="Like_Button1" ImageUrl="like.png" />
</div>
<asp:UpdatePanel runat="server" ID="updatepanel3" UpdateMode="Conditional" ChildrenAsTriggers="false">
<Triggers>
<asp:AsyncPostBackTrigger ControlID="Enter_Comment" />
</Triggers>
<ContentTemplate>
<span runat="server" class="likes">Likes: <span runat="server" id="noOfLikesPost">0</span></span>
<span runat="server" class="comments">Comments:<span runat="server" id="noOfCommentsPost">0</span></span>
<asp:Image runat="server" CssClass="CommentImage" ID="Post_Comment_Pic" />
<asp:TextBox Placeholder="Write a Comment..." onkeydown="commentTextBox_KeyDown" TextMode="multiline" Columns="50" Rows="5" ID="TextBox1" CssClass="enterComment" runat="server" />
<div runat="server" id="Div3" class="profilepiccomment">
<asp:DataList ID="dlPosts1" runat="server" CellPadding="3" CellSpacing="0">
<ItemTemplate runat="server">
<div class="commentbox">
<asp:Image ID="profileImage" runat="server" CssClass="image_icon" ImageUrl='<%# "~\\Profile_Pics\\"+ Eval("profile_pic") %>' />
<asp:Label ID="lblFriendName" CssClass="profile_pic_name" runat="server" ForeColor="Black" Text='<%# Eval("first_name") %>'></asp:Label>
<br />
<br />
<asp:Label Autosize="false" Dock="fill" ID="Comment" CssClass="comment_style" runat="server" ForeColor="Black" Text='<%# Eval("comment") %>'></asp:Label>
</div>
</ItemTemplate>
</asp:DataList>
</div>
</ContentTemplate>
</asp:UpdatePanel>
</div>
</div>
</div>
But when I click the ImageButton In First UpdatePanel the above div tag is not displayed but is displayed on any other POSTBACK.
Could anyone please help me so that the div tag is displayed only on clicking the image and not on subsequent postback.
The github account is https://github.com/Ujjwal21/ujwal_project
The above code is under Self_Home.aspx from lone 820 onwards...
Please Help!!!