有关代码的一些信息... [英] some info about code...

查看:70
本文介绍了有关代码的一些信息...的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

protected override void OnPreRender(EventArgs e)
  {
      base.OnPreRender(e); //what does this line do?
      string strDisAbleBackButton;
      strDisAbleBackButton = "<SCRIPT language=javascript>\n";
      strDisAbleBackButton += "window.history.forward(1);\n"; what this line do?
      strDisAbleBackButton += "\n</SCRIPT>";
      ClientScript.RegisterClientScriptBlock(this.Page.GetType(), "clientScript", strDisAbleBackButton); // what does this line do?
  }





what this code do?

推荐答案

在昏暗,黑暗的过去,所有文档都印在纸上,而且也很沉重.例如,Visual Studio的第一个版本(在当时被称为Visual C ++)只有一张CD和一堆书,您可以用它们来吓牛.还是在某个地方找到了他们.哦,是的,我记得他们在游戏室里.没关系.

关键是,在那些日子里,我们必须找到正确的书,阅读正确的部分,并弄清楚什么功能对我们自己有帮助.而且非常辛苦.

如今,有一个名为Google的工具可以完成大部分工作,还有一组名为MSDN的书可以完成其余工作-所有这些都可以搜索.真的很棒.

然后你来. 可以麻烦我去学习吗?"您认为. 不.我只是发布一些愚蠢的小问题,问我从互联网上搜出的每一行代码片段都做了些什么."所以你也是.
In the dim, dark past all documentation was printed on paper, and very heavy it was too. The first version of Visual Studio for example, (called Visual C++ in those days) had a single CD and pile of books you could stun an ox with. Still got them, somewhere. Oh, yes, I remember, they are in the Games Room. Never mind that.

The thing is, in those days, we had to find the right book, read the right section, and work out what functions did for ourselves. And very hard work it was too.

Nowadays, there is a tool called Google that does most of the work, and a set of books called MSDN which does the rest - and all searchable too. Amazing really.

Then you come along. "Can I be bothered to try to learn?" you think. "Nah. I''l just post stupid little questions asking what each individual line of code fragments I''ve raked up from the internet do instead." So you do. But I ain''t answering.


这似乎是来自ASP.NET自定义控件的代码.您查询的第一行调用基类''OnPreRender事件.通常这样做是为了完成基类已经可以处理的事情.您询问的另一行是使用ASP.net脚本管理器注册脚本,以便将存储在strDisAbleBackButton中的构造的javascript呈现为HTML输出.

干杯!

--MRB
This seems to be code from an ASP.NET custom control. The first line you queried about calls the base class'' OnPreRender event. This is usually done to do stuff that the base class would already handle. The other line you asked about registers the script with the ASP.net script manager so the constructed javascript stored in strDisAbleBackButton is rendered to the HTML output.

Cheers!

--MRB


这篇关于有关代码的一些信息...的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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