23
2015
04

若要再次显示该网页,Web浏览器需要重新发送您以前提交的消息

 


网页刷新的时候提示 :

若要再次显示该网页,Web浏览器需要重新发送您以前提交的消息


解决方法

1、提交完成后不要reload,而是location.href='这个页面的地址'
2、提交完成后后台直接Response.Redirect当前页面。
3、设置网页过期 可以试试在后台page_load里面用下面的代码

19
2015
04

asp.net页面中点击按钮传递给Silverlight,并且页面不刷新

转自http://blog.csdn.net/zdw_wym/article/details/7347548 

<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="Index.aspx.cs" Inherits="test.Index" %> 
 
<!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></title> 
    <script src="Scripts/jquery-1.4.1.min.js" type="text/javascript"></script> 
    <script src="Silverlight.js" type="text/javascript"></script> 
    <script type="text/javascript"> 
        function onSilverlightError(sender, args) { 
            var appSource = ""; 
            if (sender != null && sender != 0) { 
                appSource = sender.getHost().Source; 
            } 
 
            var errorType = args.ErrorType; 
            var iErrorCode = args.ErrorCode; 
 
            if (errorType == "ImageError" || errorType == "MediaError") { 
                return; 
            } 
 
            var errMsg = "Silverlight 应用程序中未处理的错误 " + appSource + "\n"; 
 
            errMsg += "代码: " + iErrorCode + "    \n"; 
            errMsg += "类别: " + errorType + "       \n"; 
            errMsg += "消息: " + args.ErrorMessage + "     \n"; 
 
            if (errorType == "ParserError") { 
                errMsg += "文件: " + args.xamlFile + "     \n"; 
                errMsg += "行: " + args.lineNumber + "     \n"; 
                errMsg += "位置: " + args.charPosition + "     \n"; 
            } 
            else if (errorType == "RuntimeError") { 
                if (args.lineNumber != 0) { 
                    errMsg += "行: " + args.lineNumber + "     \n"; 
                    errMsg += "位置: " + args.charPosition + "     \n"; 
                } 
                errMsg += "方法名称: " + args.methodName + "     \n"; 
            } 
 
            引发新错误(errMsg); 
        } 
    </script> 
</head> 
<body> 
    <form id="form1" runat="server"> 
    <div> 
        <asp:ScriptManager ID="ScriptManager1" runat="server"> 
        </asp:ScriptManager> 
        <asp:UpdatePanel ID="UpdatePanel1" runat="server" UpdateMode="Conditional"> 
            <ContentTemplate> 
                <input type="button" class="btn-search" value="查询" id="btnSearch" /> 
                <div style="width: 100%; height: 700px"> 
                    <object id="SL" data="data:application/x-silverlight-2," type="application/x-silverlight-2" 
                        width="100%" height="700px"> 
                        <param name="source" value="ClientBin/SL.xap" /> 
                        <param name="onError" value="onSilverlightError" /> 
                        <param name="background" value="white" /> 
                        <param name="minRuntimeVersion" value="4.0.60310.0" /> 
                        <param name="autoUpgrade" value="true" /> 
                        <param name="windowless" value="true" /> 
                        <a href="
http://go.microsoft.com/fwlink/?LinkID=149156&v=4.0.60310.0" style="text-decoration: none"> 
                            <img src="
http://go.microsoft.com/fwlink/?LinkId=161376" alt="获取 Microsoft Silverlight" 
                                style="border-style: none" /> 
                        </a> 
                    </object> 
                </div> 
            </ContentTemplate> 
        </asp:UpdatePanel> 
    </div> 
    </form> 
</body> 
</html> 
<script type="text/javascript" language="javascript"> 
    $(document).ready(function () { 
        $("#btnSearch").click(function () { 
            getMess(); 
        }); 
    }); 
 
    function getMess() { 
        $.post("Index.aspx", { 
            "action": "search", 
            "param": "level" 
        }, function (data) { 
            setTimeout(function () { 
                var slHost = document.getElementById("SL"); 
                var page = slHost.Content.Page; 
                page.process(data); 
            }, 1000); 
        }); 
    } 
</script> 

19
2015
04

ASP.NET传递参数到Silverlight


一、使用InitParams 


在Silverlight宿主页面加载时,我们在ASPX页面中获取参数,并作为初始化参数传递给Silverlight应用程序,如下代码所示:


protected void Page_Load(object sender, EventArgs e)
{
    this.Xaml1.InitParameters = String.Format("username={0},email={1}",
        Request.QueryString["username"],
        Request.QueryString["email"]);
}

29
2015
03

IE11无法显示ReportViewer打印按钮的问题

 

解决方法1 :

a. update "Report Viewer 2012 Runtime" to 11.1.3366
b. update "Microsoft .Net Framework" to 4.5.1
c. reboot system
Our environment: Win server 2008 r2, IIS7, ReportViewer 11

27
2015
03

Silverlight减小XAP文件大小,提高文件加载速度

 

Silverlight项目发布的时候要勾选 “通过使用应用程序库缓存减小XAP大小”,如果引用的是库文件,还需要添加对应的extmap.xml 文件‘


假如项目引用的是库文件,如c:\project\ Microsoft.Windows.Controls.dll,那就在c:\project\ 目录下[不能在silverlight工程的bin\debug下]建立Microsoft.Windows.Controls.extmap.xml,具体内容参考如下:
  <?xml version="1.0"?>
  <manifest xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema">
   <assembly>
    <name>Microsoft.Windows.Controls</name>
    <version>2.0.21027.1502</version>
    <publickeytoken>31bf3856ad364e35</publickeytoken>
    <relpath>Microsoft.Windows.Controls.dll</relpath>
    <extension downloadUri="Microsoft.Windows.Controls.zip" />
   </assembly>
  </manifest>

23
2015
03

Silverlight页面动态生成添加控件

 

public partial class dynamicControl : UserControl
    {
        public dynamicControl()
        {
            InitializeComponent();

17
2015
03

RadGrid 默认多字段分组和选择列

 

 

 

<body>
    <form id="form1" runat="server">
    <div>
        <telerik:RadScriptManager ID="RadScriptManager1" runat="server">
            <Scripts>
                <asp:ScriptReference Assembly="Telerik.Web.UI"
                    Name="Telerik.Web.UI.Common.Core.js" />
                <asp:ScriptReference Assembly="Telerik.Web.UI"
                    Name="Telerik.Web.UI.Common.jQuery.js" />
            </Scripts>
        </telerik:RadScriptManager>

05
2015
03

重构artDialog.prompt方法,让它支持多行文本

 

 

        artDialog.prompt = function (content, yes, value) {
            value = value || '';
            var input;

06
2015
01

Radgrid实现行合并

 

 


  public static void MergeRows(RadGrid RadGrid1)
        {
            for (int i = RadGrid1.Items.Count - 2; i > 0; i--)
            {
                if (RadGrid1.Items[i][RadGrid1.Columns[0]].Text == RadGrid1.Items[i - 1][RadGrid1.Columns[0]].Text)
                {
                    RadGrid1.Items[i - 1][RadGrid1.Columns[0]].RowSpan = RadGrid1.Items[i][RadGrid1.Columns[0]].RowSpan < 2 ? 2 : RadGrid1.Items[i][RadGrid1.Columns[0]].RowSpan + 1;                    
                    RadGrid1.Items[i][RadGrid1.Columns[0]].Visible = false;
                    //RadGrid1.Items[i][RadGrid1.Columns[0]].Text = "&nbsp;"; 
                }
            }
            //To mau lai cho Radgird
            foreach (GridDataItem dataItem in RadGrid1.Items)
            {
                foreach (GridColumn col in RadGrid1.MasterTableView.RenderColumns)
                {
                    //if (dataItem[col.UniqueName].Text == string.Empty)
                    dataItem[col.UniqueName].Style.Add("border-left", "solid 1px #ededed");
                }
            }   
        }

25
2014
12

控件包含代码块(即 <% ... %>),因此无法修改控件集合。

 

 


ASP.net 调试出现如下错误,
控件包含代码块(即 <% ... %>),因此无法修改控件集合。

元原因是的 在  <head></head> 之间 有  runat="server" 元素,并且里面又有 <% %> , 这两个是不兼容的