解决方案 »

  1.   

    可以在A页面通过ViewState["hiddenValue"]="";将值放进去,然后在B页面再ViewState["hiddenValue"]将值取出来。
      

  2.   

    原来这个控件还可以这样用啊。和session差不多。说实话没用过。
      

  3.   

    看懂这个《ASHX呼叫ASPX.cs的方法
    你的问题也一定不是问题。
      

  4.   

    http://hi.baidu.com/bj_chengrong/item/7506d8b51baf469318469739
      

  5.   

    你的意思是要动态获取?
    一个网站不能同时显示俩个页面啊。除非你用iframe之类的。那样可以添加个类嘛。
    A页面的时候赋值(如果只是单纯的前端,不管是ajax还是其他方法,一定可以传给后台的嘛)
    B页面取一下。跟session差不多吧。
      

  6.   

    先搞清楚哪里来的“一个页面、另一个页面”吧,不然会出现很可笑的“例子”的。建议你找你的老师补习一下 asp.net 页面“生存期到底有多长久”的基础知识。
      

  7.   


    前端在“页面”上执行什么东西的时候,在asp.net端已经不存在页面。因此需要明确说明这个“传给后台”的具体概念、机制、流程,而不是“asp.net页面”。否则就会越说越乱。
      

  8.   

    是这样的,我的一个页面A中通过iframe引入-个页面B,这个页面B上有—个用户控件,用户控件就有-个hiddnfield控件,我就是想取里面的值,
      

  9.   

    是这样的,我的一个页面A中通过iframe引入-个页面B,这个页面B上有—个用户控件,用户控件就有-个hiddnfield控件,我就是想取里面的值,
      

  10.   

    http://www.cnblogs.com/liyuxin/archive/2011/10/06/2199931.html
      

  11.   

    授人鱼不如授人渔,这里给你提供一个思路,你可以在A后台获得B页面的源码,然后从源码中读取数据,读取数据的时候一般会用到正则表达式;举个栗子:
    decimal USD = 0;
                decimal EUR = 0;
                decimal MYR = 0;
                decimal IND = 0;
                WebResponse webResponse = WebRequest.Create("https://uniservices1.uobgroup.com/secure/online_rates/foreign_exchange_rates_against_singapore_dollar.jsp?s_pid=HOME201205_eg_quicklnk_ql7").GetResponse();
                StreamReader streamReader = new StreamReader(webResponse.GetResponseStream(), System.Text.Encoding.GetEncoding("GB2312"));
                string content = streamReader.ReadToEnd();
                MatchCollection matches = Regex.Matches(content, @"(?is)(?<=<td[^>]*?>).*?(?=</td>)");
                foreach (Match match in matches)
                {
                    if (match.Value == "USD")
                        USD = SafeValue.ChinaRound((SafeValue.SafeDecimal(match.NextMatch().NextMatch().NextMatch().Value, 0) + SafeValue.SafeDecimal(match.NextMatch().NextMatch().NextMatch().NextMatch().Value, 0)) / 2, 4);
                    if (match.Value == "EUR")
                        EUR = SafeValue.ChinaRound((SafeValue.SafeDecimal(match.NextMatch().NextMatch().NextMatch().Value, 0) + SafeValue.SafeDecimal(match.NextMatch().NextMatch().NextMatch().NextMatch().Value, 0)) / 2, 4);            }            webResponse = WebRequest.Create("https://secure.mas.gov.sg/msb/ExchangeRatesFeed.aspx?currency=myr").GetResponse();
                streamReader = new StreamReader(webResponse.GetResponseStream(), System.Text.Encoding.GetEncoding("GB2312"));
                content = streamReader.ReadToEnd();
                matches = Regex.Matches(content, @"(?is)(?<=<title[^>]*?>).*?(?=</title>)");
                MYR = SafeValue.SafeDecimal(SafeValue.SafeDecimal(matches[1].Value.Substring(5, 5), 0) / 100, 0);            webResponse = WebRequest.Create("https://secure.mas.gov.sg/msb/ExchangeRatesFeed.aspx?currency=ind").GetResponse();
                streamReader = new StreamReader(webResponse.GetResponseStream(), System.Text.Encoding.GetEncoding("GB2312"));
                content = streamReader.ReadToEnd();
                matches = Regex.Matches(content, @"(?is)(?<=<title[^>]*?>).*?(?=</title>)");
                IND = SafeValue.SafeDecimal(SafeValue.SafeDecimal(matches[1].Value.Substring(5, 5), 0) / 100, 0);            string sql = "update XXCurrency set CurrencyExRate='{0}' where CurrencyId='{1}'";
                if (USD != 0)
                    C2.Manager.ORManager.ExecuteCommand(string.Format(sql, USD, "USD"));
                if (EUR != 0)
                    C2.Manager.ORManager.ExecuteCommand(string.Format(sql, EUR, "EUR"));
                if (MYR != 0)
                    C2.Manager.ORManager.ExecuteCommand(string.Format(sql, MYR, "MYR"));
                if (IND != 0)
                    C2.Manager.ORManager.ExecuteCommand(string.Format(sql, IND, "INR"));