Sign In| Join
Get Help:Ask a Question in our Forums|Report a Bug|More Help Resources
Member
26 Points
65 Posts
Nov 14, 2011 06:42 AM|LINK
Dear All,
I want to call a jquery method. I am using the master pages in the project. I want to know exactly how and where implement the jquery.
Code snippets in a from:
<asp:Content ID="cntRegistration" runat="server" ContentPlaceHolderID=cphBase>
<asp:UpdatePanel ID="upRegistration" runat="server">
<ContentTemplate>
<table width=100% height=100% bordercolor="blue">
<asp:TextBox ID="txtUserName" runat="server" text=”testjquery”></asp:TextBox>
</table>
</ContentTemplate>
</asp:UpdatePanel>
</asp:Content>
Queries:
1. Where to call the .js files, in master page or in a form? [I hope it should be in the master page, is it right?]
2. where to write the scripsts in a form? Is it between the asp:content and asp:updatepanel? Can explain exact place to put the scripts?
Script Ceode snippets:
<script type="text/javascript" id="demo">
$(document).ready(function () {
$("#txtNoOfMales").change(function () {
var ticketRequired = this.value;
var options = {
type: "POST",
url: "Register.aspx/GetAvailableTicketsForMales",
data: "{no:" + ticketRequired + "}",
contentType: "application/json; charset=utf-8",
dataType: "json",
success: function (response) {
if (response.d != "") {
alert(response.d);
$("#txtNoOfMales").focus();
}
}; $.ajax(options); });
</script>
3. I am getting the javascript script message box within the update panel? why it so, any work around?
MM_MSDN
Member
26 Points
65 Posts
How and where to call a jquery method in a form binded with master page?
Nov 14, 2011 06:42 AM|LINK
Dear All,
I want to call a jquery method. I am using the master pages in the project. I want to know exactly how and where implement the jquery.
Code snippets in a from:
<asp:Content ID="cntRegistration" runat="server" ContentPlaceHolderID=cphBase>
<asp:UpdatePanel ID="upRegistration" runat="server">
<ContentTemplate>
<table width=100% height=100% bordercolor="blue">
<asp:TextBox ID="txtUserName" runat="server" text=”testjquery”></asp:TextBox>
</table>
</ContentTemplate>
</asp:UpdatePanel>
</asp:Content>
Queries:
1. Where to call the .js files, in master page or in a form? [I hope it should be in the master page, is it right?]
2. where to write the scripsts in a form? Is it between the asp:content and asp:updatepanel? Can explain exact place to put the scripts?
Script Ceode snippets:
<script type="text/javascript" id="demo">
$(document).ready(function () {
$("#txtNoOfMales").change(function () {
var ticketRequired = this.value;
var options = {
type: "POST",
url: "Register.aspx/GetAvailableTicketsForMales",
data: "{no:" + ticketRequired + "}",
contentType: "application/json; charset=utf-8",
dataType: "json",
success: function (response) {
if (response.d != "") {
alert(response.d);
$("#txtNoOfMales").focus();
}
}
}; $.ajax(options); });
</script>
3. I am getting the javascript script message box within the update panel? why it so, any work around?