
正文
asp.net4.5.,ASPNET45512尚未在web服务器上注册
提示:扫一扫查出行【扫一扫了解最新限行尾号】
复制提示
asp。net4.5 专业英语翻译。
简单意译了一下:
当有错误通知到PageRequestManager的时候,它会重定向到ErrorPage.aspx页面。并将产生错误的URL附加到该页面的QueryString中的aspxErrorPath参数。类似这样:
你可以在ErrorPage.aspx中编码来读取aspxErrorPath信息。比如你可以包含一个Retry按钮来让用户重试之前的页面。
string url = Request.QueryString["aspxerrorpath"];
if (url ! = null) Response.Redirect(url);
如果你的网站自定义了错误页面但是你不希望其应用到异步提交(比如ajax)。你可以设置ScriptManager.AllowCustomErrorsRedirect属性为false。
在比较复杂的页面,你可能包含多个UpdatePanel。在这种情况下,当其中一个UpdatePanel触发的时候,所有的UpdatePanel都会被刷新。
所以当你有多个UpdatePanel,而且每一个都是完全自包含的(就是并没有嵌套,这很重要)。这时候,你需要将每个Panel设置为独立刷新的。只需要设置UpdatePanel.UpdateMode属性从Always改为Conditional。这样,UpdatePanel内的控件触发的刷新就只刷新自己了。
试一下这种情况,创建一个页面包含多个UpdatePanel,每个都包含自己的按钮。添加以下代码,刷新当前时间到相关的Label。
{代码段}
当你按下按钮,只有相应的UpdatePanel会被更新,其他的保持不变。
相关问答
Q1: 现在有6段asp.net4.5英文,求翻译。
1. When rendering the HTML, the UpdatePanel looks at its contents and notices that it contains one control that can trigger a postback—the button. The UpdatePanel adds some JavaScript code that will intercept the button’s Click event on the client and use a JavaScript routine to handle it.
渲染Html的时候,UpdatePanel会检测其自身内容并且注意到其包含了一个可以出发回传的控件:按钮。UpdatePanel会添加一些会拦截按钮客户端单击事件的JavaScript代码,并使用JavaScript程序来处理它。
2. When you click the Refresh Time button, you trigger the JavaScript routine.
当你单击刷新时间按钮的时候,你会触发该JavaScript程序。
3. The JavaScript routine doesn’t perform a full-page postback. Instead, it sends a background request to the web server. This request is asynchronous, which means your page remains responsive while the request is under way.
该JavaScript程序不会执行整页回传。取而代之的是,它向网络服务器发送一个背景请求。该请求是异步的,也就是说当请求正在被执行的时候,你的页面仍然保持可响应状态。
4. The background request is processed in exactly the same way as a normal postback. All the data from all the web controls is sent back to the web server, along with the view state information and any cookies. On the web server, the page life cycle is the same—first the Page.Load event fires, followed by the event that triggered the postback (in this case, Button.Click). If you’re using data source controls such as SqlDataSource, all the normal querying and data binding takes place. The final page is then rendered to HTML and sent back to the page.
背景请求是按照与常规回传完全一样的方式处理的。来自所有网络控件的所有数据被发送回网络服务器,包括视图状态信息以及所有的cookie。在网络服务端,页面生命周期是一样的:首先,Page.Load事件被触发,然后是触发回传的事件。(在本例中即为Button.Click事件)如果你正在使用数据源控件如SqlDataSource控件,所有的常规查询和数据绑定会照常执行。最后的页面被渲染成Html然后被发送回页面。
5. When the browser receives the rendered HTML for the page, it updates the current view state and grabs any cookies that were returned.
当浏览器接收到为页面准备的渲染后的Html,它会更新当前的视图状态,并获取所有返回的cookie。
6. The JavaScript routine then replaces a portion of the HTML on the page—just the portion that you wrapped in the UpdatePanel. The rest of the HTML for the page is simply discarded. In the current example, that means the HTML with the animated GIF is tossed out. (This really has no effect, because this part of the HTML is exactly the same in the new response as it was originally. However, it’s important to understand that if you modify this part of your page on the web server, you won’t see the results of your change in the web browser, because that area of the page isn’t being updated.)
JavaScript程序会取代页面上Html的一部分:就是被你包裹在UpdatePanel中的那部分。页面Html的其他部分会被简单地销毁。在本例中,这意味着包含动态gif图片的Html会被销毁。(这其实没有任何作用,因为这部分的Html与服务端响应的是完全相同的。但是理解这一点十分重要:如果你在服务端修改了你页面的一部分,你不会在浏览器中看到你修改的结果,因为那部分的页面没有被更新)
Q2: .net4.5程序发布到服务器上,iis程序池选的ASP .NET v4.0,已安装.NET Framework 4.5.2,报错如图,什么原因
你看看,检查一下你的Bin文件夹下有没有System.Web.Http.WebHost.dll文件,如果有,请检查dll的版本。将System.Web.Http.WebHost.dll 4.0版本的文件放入到Bin文件夹下,基本就能解决此问题了!
但是有可能会提醒其他未能加载文件或者程序集错误,请检查你发布的文件,是否版本一致
asp.net4.5.的介绍就聊到这里吧,感谢你花时间阅读本站内容,更多关于ASPNET45512尚未在web服务器上注册、asp.net4.5.的信息别忘了在本站进行查找喔。






