如何将调试器放入RegisterClientScriptBlock [英] How to put debugger in RegisterClientScriptBlock

查看:58
本文介绍了如何将调试器放入RegisterClientScriptBlock的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述


我在aspx.vb中有以下代码(页面后面的代码)


Me.RegisterClientScriptBlock("CloseMe_2",< script language =''javascript''>"&_
警报(document.forms(0).txtIdentifierXml.value);" &_
"window.returnValue = document.forms(0).txtIdentifierXml.value;" &_
</script>")

我想让tp调试器在该代码中检查该值.

请帮助我

Hi
I have the following code in aspx.vb ( code behind page)


Me.RegisterClientScriptBlock("CloseMe_2", "<script language=''javascript''>" & _
"alert(document.forms(0).txtIdentifierXml.value);" & _
" window.returnValue = document.forms(0).txtIdentifierXml.value;" & _
" </script>")

I want tp put debugger in that code to check the value.

please help me

推荐答案

您提供的代码行仅将第二个参数注册到客户端脚本块.这意味着它将提供给浏览器执行.

换句话说,代码不会在这里执行,而是会在浏览器中执行.(它是JavaScript之后,只能与浏览器一起使用).

您想在这里看到哪些值?是txtIdentifierXml.value吗?
如果是,则如上所述,该值将在此处不可用.执行脚本后,您应该在警报中获取该值.

提供了您的document.forms(0).txtIdentifierXml不为空
The line of code you have given just registers the second argument to the client script block. Which means it will be given to the browser to execute.

In other words the code will not be executed here but it will be executed at the browser.(After it is a javascript, bound to work with browser only).

Which value you want to see here? Is it txtIdentifierXml.value?
If yes, As stated above that value will not be available here. When the script is executed you should get the value in the alert.

Provided your document.forms(0).txtIdentifierXml is not null


这篇关于如何将调试器放入RegisterClientScriptBlock的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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