如何在C#代码后面显示javascript提示框 [英] how to show javascript prompt box in c# code behind

查看:87
本文介绍了如何在C#代码后面显示javascript提示框的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

你好,

我想要按钮单击事件中的javascript提示框.
我搜索了很多,但是找不到合适的结果.
有谁知道或提供链接或建议我该怎么做.

谢谢

Hello,

I want javascript prompt box in button click event.
I have searched many, but I can''t get appropriate result.
Is there anyone who know or provide link or suggest me how to do.

Thank You

推荐答案

请检查正确答案 [ ^ ],用于问题 [此答案 [ RegisterStartupScript [ JavaScript提示框 [
Please check the correct answer[^] for the question Display a "Yes / No" alert box in C# code behind[^], where there are two solutions to do it in aspx and code behind page.

You can also go for this answer[^], where you have to use RegisterStartupScript[^] to build the confirm or prompt box.

[update] (as per the comments added by OP)

For your requirement (to show one prompt box to take input from User), you just need to write javascript codes for that using RegisterStartupScript.
You can find example of prompt box and codes at JavaScript Prompt Boxes[^]. You just need to write these codes inside RegisterStartupScript
Just try it out and let me know what problems you are facing.

[/update]

Thanks...


这篇关于如何在C#代码后面显示javascript提示框的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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