如何从子文件夹中的aspx读取Jquery [英] How Can Read Jquery From aspx in the Subfolder

查看:71
本文介绍了如何从子文件夹中的aspx读取Jquery的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

如何从IIS服务器上的子文件夹中的aspx文件中读取jquery。我可以使用visual studio运行,但是当我上传到iis时,子文件夹中的aspx文件无法读取jquery。我尝试了各种各样的方法,但仍然没有成功。



当我去子文件夹中的aspx文件时,页面desain将被打破,我无法'连接到该页面上的数据库



以下是url jquery和css

< link href =  <%= ResolveUrl(〜/  )%> css / screen.css rel =   stylesheet type =   text / css /> 
< link href = <%= ResolveUrl(〜/ )%> Content / chosen.css rel = stylesheet type = text / css />
< script src = <% = ResolveUrl( 〜/%> 脚本/ jquery- 1.8.3.min.js type = text / javascript > < / script >





下面是子文件夹中form.aspx上使用的示例ajax

函数GetDataMOU( ){
var mouNO = $(' #<%= DropDownAO.ClientID%>')。val();
$ .ajax({
type: POST
url: form-detail.aspx / GetDataMOU
data:' {valueMOU:' + mouNO + ' < span class =code-string>}',
contentType: application / json; charset = utf-8
dataType: json
成功:函数(响应){
$(' #<%= txtBranchID。 ClientID%>')。val(response.d [ 0 ]);
$(' #<%= txtCustID.ClientID%>')。val(response.d [ 1 ]);
$(' #<%= txtCustName.ClientID%>')。val (response.d [ 2 ]);
$(' #<%= txtCustType.ClientID%>')。val (response.d [ 3 ]);
},
错误:函数(响应){
alert(response.d);
}
});

return false ;
}

解决方案

' #<%= DropDownAO.ClientID%>')。val();


.ajax({
type: POST
url: form-detail.aspx / GetDataMOU
data:' {valueMOU:' + mouNO + ' }'
contentType: application / json; charset = utf-8
dataType: json
success:function(response){


' #<%= txtBranchID.ClientID%>')。val(response.d [ 0 ]);

How can I read jquery from aspx file in a sub folder on IIS server. I can run using visual studio, but when I upload to iis, jquery couldn't be read by the aspx file in a sub folder. I've tried various ways but still have not succeeded.

when i go to aspx file in the sub folder, then the page desain will be broken and i couldn't connect to database on that page

below are url jquery and css

<link href="<%= ResolveUrl("~/") %>css/screen.css" rel="stylesheet" type="text/css" />
    <link href="<%= ResolveUrl("~/") %>Content/chosen.css" rel="stylesheet" type="text/css" />
   <script src="<%= ResolveUrl("~/") %>Scripts/jquery-1.8.3.min.js" type="text/javascript"></script>



Below are the sample ajax that used on the form.aspx in the subfolder

function GetDataMOU() {
            var mouNO = $('#<%= DropDownAO.ClientID %>').val();
            $.ajax({
                type: "POST",
                url: "form-detail.aspx/GetDataMOU",
                data: '{valueMOU: "' + mouNO + '"}',
                contentType: "application/json; charset=utf-8",
                dataType: "json",
                success: function (response) {
                    $('#<%= txtBranchID.ClientID %>').val(response.d[0]);
                    $('#<%= txtCustID.ClientID %>').val(response.d[1]);
                    $('#<%= txtCustName.ClientID %>').val(response.d[2]);
                    $('#<%= txtCustType.ClientID %>').val(response.d[3]);
                },
                error: function (response) {
                    alert(response.d);
                }
            });

            return false;
        }

解决方案

('#<%= DropDownAO.ClientID %>').val();


.ajax({ type: "POST", url: "form-detail.aspx/GetDataMOU", data: '{valueMOU: "' + mouNO + '"}', contentType: "application/json; charset=utf-8", dataType: "json", success: function (response) {


('#<%= txtBranchID.ClientID %>').val(response.d[0]);


这篇关于如何从子文件夹中的aspx读取Jquery的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆