如何将功能从asp绑定到html按钮单击? [英] How can I bind a function from asp to an html button click?

查看:101
本文介绍了如何将功能从asp绑定到html按钮单击?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我需要将此代码块绑定到html按钮:

I need to bind this block of code to an html button:

public static string GetPageContent(string FullUri)
{
        HttpWebRequest Request;
        StreamReader ResponseReader;
        Request = ((HttpWebRequest)(WebRequest.Create(FullUri)));
        ResponseReader = new StreamReader(Request.GetResponse().GetResponseStream());
        return ResponseReader.ReadToEnd();
}



有人可以帮我吗?

在此先谢谢您.



Can any one help me please?

Thanks in advance.

推荐答案

将runat ="server"添加到您的按钮,然后像其他ASP.net按钮服务器控件一样连接click事件处理程序. />
一个问题,您从哪里获得FullUri参数?
Add runat="server" to your button, then wire up a click event handler as with any ASP.net button server control.

One question, where are you getting the FullUri parameter from?


这篇关于如何将功能从asp绑定到html按钮单击?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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