我有一个 Jquery 文件(“Maestro.js”)和一个函数:
function SetDDLNumbers () {
for (var i = 0; i < 51; i++) {
$('#ContentPlaceHolder3_ShuttersCount').append(new Option(i, i));
$('#ContentPlaceHolder3_CollectedCount').append(new Option(i, i));
$('#ContentPlaceHolder3_ValimCount').append(new Option(i, i));
$('#ContentPlaceHolder3_UCount').append(new Option(i, i));
$('#ContentPlaceHolder3_ShoeingCount').append(new Option(i, i));
$('#ContentPlaceHolder3_EnginCount').append(new Option(i, i));
$('#ContentPlaceHolder3_ProtectedSpaceCount').append(new Option(i, i));
$('#ContentPlaceHolder3_GlassCount').append(new Option(i, i));
$('#ContentPlaceHolder3_BoxesCount').append(new Option(i, i));
}
});
My asp file and the PageLoad function is :
protected void Page_Load(object sender, EventArgs e)
{
GridViewRow row = (GridViewRow)Session["selectedrow"];
int ProjectID = Convert.ToInt32(row.Cells[1].Text);
DBservices db = new DBservices();
DataTable dt = db.GetCustomerInformation(ProjectID);
if (!Page.IsPostBack)
{
SetPageDetails(dt);
SetProjCurrentStatus();
LoadSuppliers();
}
GetOrderStatus();
}
aspx 文件是母版页的内容页,包含以下行:
<script src="javascript/maestro.js" type="text/javascript"></script>
我想在“!Page.IsPostBack”部分中调用 SetDDLNumbers 函数。
if (!Page.IsPostBack)
{
SetPageDetails(dt);
SetProjCurrentStatus();
LoadSuppliers();
}
当我尝试写: SetDDLNumbers() 时,它告诉我该函数无法识别。我怎么能调用这个函数?