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
shreyas R S
NA
1
2.5k
javascript to check if checkbox is checked asp.netuser cntrl
Mar 14 2013 3:03 PM
Hi All,
I have a html checkbox control and Button in my User control.
Now i need to check whether checkbox is checked when button is clicked.
I am using the below code. But it does not work :(
In webusercontrol1.ascx,
<script type="text/javascript">
$(document).ready(function () {
$("input[id*=remember]").change(function () {
debugger;
if (this.checked)
alert("its checked");
else
alert("notchecked");
});
});
</script>
<table>
<tr>
<td>
<input id="remember" name="remember" type="checkbox" />
</td>
<td>
<asp:Button ID="Button1" runat="server" Text="Button" OnClick="Button1_Click" />
</td>
</tr>
</table>
In webusercontrol1.ascx.cs,
protected void Button1_Click(object sender, EventArgs e)
{
ScriptManager.RegisterStartupScript(this, this.GetType(), Guid.NewGuid().ToString(), "function();", true);
// my rest of the code once checkbox is clicked
}
Reply
Answers (
1
)
Google Translate
Multiple images uploading with Database(sqlserver 2008)