如何使用ASP.net获取a,b值? [英] How to fetch a,b value using ASP.net?

查看:51
本文介绍了如何使用ASP.net获取a,b值?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述





我想在ASP.Net中获取一些值,在Common url中的web服务器中配置的XML数据下面(url和appid在Ajax mehtod中有) )和appid。



Hi,

I want fetch some value in ASP.Net, below XML data configured in web server in Common url(url and appid is there in Ajax mehtod) and appid.

<MPulpy>
<root>
<a>Denis Matthews</a>
<b>50 Piano Classics for Relaxation</b>
<c>US6R21404531</c>
</root>
<root>
<a>Arthur Rubinstein</a>
<b>50 Piano Classics for Relaxation</b>
<c>US6R21404543</c>
</root>
<root>
<a>Whilhelm Backhaus</a>
<b>50 Piano Classics for Relaxation</b>
<c>US6R21404542</c>
</root>
<root>
<a>Denis Matthews</a>
<b>50 Piano Classics for Relaxation</b>
<c>US6R21404548</c>
</root>
<MPulpy>


After that i want to fetch a, b value using ASP.net in Sciprt and AJAX, Problem is , I got only first Alert (i.e)function ShowData() {
            alert("Success");
i can't get any data from Ajax Mehtod... kindly help me...

<%@ Page Language="C#" AutoEventWireup="true" CodeFile="Default.aspx.cs" Inherits="_Default" %>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
    <title>Show Time</title>
    <script src="script/jquery-1.3.2.min.js" type="text/javascript"></script>
    <script type = "text/javascript">
        function ShowData() {
            alert("Success");
            var p1 = $("#p1").val();
            $.ajax({
                type: 'POST',
                url: "https://mindapp-pulpy.rhcloud.com/AuthXmlPulpy",
                data: {
                    appid: 'MPAPP_0028',
                    p1: p1
                },

                dataType: "xml",
                success: function (data) {

                    alert("Sucesss");
                    $(data).find("root").each(function () {
                        a = $(this).find("a").text();
                        b = $(this).find("b").text();
                        //c=$(this).find("c").text();
                        $("#result").append('<li>Artist:' + ' ' + a + '<br>Album:' + ' ' + b + '</br></li><br>');
                        alert("#result");
                    });
                    alert(data);
                }

            });   //ajax ends
        }
    </script>

</head>
<body>
    <form id="form1" runat="server"> 
    <div>
    Test APP<br />
    <input type="text" id="p1" name="p1" class="user-text1 textboxes" /><br />
    <input id="btnGetTime" type="button" value="Submit" onclick = "ShowData()"  /><br />
        <br />
        <br />
    </div>
    </form>
</body>
</html></br>

推荐答案

#p1)。val();
("#p1").val();


.ajax({
type :' POST'
url: https://mindapp-pulpy.rhcloud.com/AuthXmlPulpy
数据:{
appid:' MPAPP_0028'
p1:p1
},

dataType: xml
成功:函数(数据){

alert( 成功 );
.ajax({ type: 'POST', url: "https://mindapp-pulpy.rhcloud.com/AuthXmlPulpy", data: { appid: 'MPAPP_0028', p1: p1 }, dataType: "xml", success: function (data) { alert("Sucesss");


(data).find( root ).each(function(){
a =
(data).find("root").each(function () { a =


这篇关于如何使用ASP.net获取a,b值?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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