asp.net响应html链接

时间:2012-05-04 14:20:52

标签: asp.net html

我是asp.net的新手,所以忍受我 -

我需要一个asp.net webform来显示单独的html文件的内容。在Html文件中,我需要标记一些文本,以便它调用asp.net方法。 所以,我不能使用asp.net linkbutton作为例如因为链接需要在html文件中,而不是webform。 此外,html文件中的链接不是网页的帖子,它需要调用asp.net方法。

我想在webform中显示html文件的内容,但是文件本身必须包含链接。

有关最佳方法的任何想法吗?托管html文件的最佳asp.net控件是什么? 谢谢你...

所以,问题是 - 在下面的代码中,myTag应该是什么? 也许是javascript中的东西?它应该能够将单词“that”传递给CodeBehind ...

中的方法
`//this is the contents of my html file`        
<p>to be or not to be, <myTag>that</myTag>  is the question</p>


//here's my asp.net webform

<body>
    <form id="form1" runat="server">
    <div>
    <iframe src ="myhtml.html" width="100%" style="height: 329px" ></iframe>
    </div>
    </form>
</body>


//finally, here's a code behind method
protected void SomeMethodThatRespondsTo_myTagBeingClicked()
    {
        Text1.Text = "you clicked something";
    }

0 个答案:

没有答案