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
Dennis Grønbæk Pedersen
NA
8
1.7k
Using jQuery div click - call c# method
Mar 10 2015 5:28 PM
I'm trying to call an onClick from my LinkButton, when i click the div.content2, can anyone tell me, what i'm doing wrong?
The reason i'm trying to do it this way, is that i already have a function on this div, and i think it would be "nicer" if it all happened at once.
This is my HTML:
<asp:LinkButton ID="lnkUpdate" runat="server" OnClick="setRead_Click" CommandName='<%# Eval("MessageID") %>' Visible="true" Text='<%# Eval("MessageID") %>' />
<div class="container2">
<div id="read" runat="server" class="header2">
<span>Expand</span>
</div>
<div class="content2">
<div class=" m-t-sm">
<asp:Label ID="lblMessage" runat="server" Text='<%# Eval("Message") %>' />
</div>
</div>
</div>
This is my jQuery script:
<script>
$(".header2").click(function () {
$("#lnkUpdate").click();
$header2 = $(this);
$content2 = $header2.next();
$content2.slideToggle(500, function () {
$header2.text(function () {
return $content2.is(":visible") ? "Collapse" : "Expand";
});
});
});
</script>
Reply
Answers (
5
)
JavaScript Loading Image
print infopath form.not whole page in sharepoint