-1

我正在尝试输出x以下请求中的值:http://localhost:4827/Default.aspx?x=123123

我根本没有输出。这是我的代码:

using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Net.Mail;

using MPads.Common;
using MPads.WebPatientPortal.Interfaces;
using MPads.WebPatientPortal.Presenters;
using MPads.BusinessLogic.Interfaces;
using MPads.Components.Interfaces;
using MPads.DataAccess;

using MPads.DataAccess.Interfaces;
using System.Text;
using System.Diagnostics;


namespace MPads.WebPatientPortal
{
    public partial class Default : System.Web.UI.Page, IDefault
    {


        private DefaultPresenter _presenter;

        protected void Page_Load(object sender, EventArgs e)
        {
            Response.Cache.SetCacheability(HttpCacheability.NoCache);
            _presenter = new DefaultPresenter();

            var fields = Request.QueryString;

            if (fields.Count > 0)
            {
                var x = Utilities.GetNvpValue(fields, "x").ToString();
                Trace.Write(x);
            }


        }


        public void loadAjaxContent(string content)
        {
            Page.RegisterStartupScript("myScript", " <script type=\"text/javascript\"> loadAjaxContent('" + content + "','POST',null); </script>");
        }

        public void DisplayMessage(string message)
        {
        }



    }
}
4

2 回答 2

2

您是否在 ASPX 中设置了偶数处理程序?

假设你这样做:考虑而不是Trace.Write();使用Response.Write();

Trace.Write();写入跟踪侦听器(您可以在页面底部显示)。

Response.Write();将文本结果直接输出到您的页面,而不是通过跟踪侦听器。

于 2012-06-11T20:34:49.820 回答
0

Use Glimpse to find out this, here's the link Glimpse-A client side Glimpse to your server

于 2012-06-11T21:03:03.637 回答