Asp.Net 嵌套表单 [英] Asp.Net nested form

查看:34
本文介绍了Asp.Net 嵌套表单的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我需要提供一个 html 表单(不是服务器表单)以在 asp.net 网络表单网站中进行搜索.该表单将发布到另一个网站,在那里执行索引搜索.看到嵌套表单在 asp.net 中无法正常工作,最简单的方法是什么?

I need to supply an html form (not a server form) for searching within an asp.net web-forms website. The form will post to another website where an indexed search is performed. Seeing as nested forms don't work well in asp.net, what is the simplest approach for this?

嵌套表单是一个简单的 html 表单,它对搜索网站执行获取",我无法对其进行编程控制.

The nested form is a simple html form that performs a "get" against the search website, which I do not have programmatic control over.

更新:我通过简单地将服务器表单移动到页面上的适当位置来解决我的问题,而不是让它围绕整个页面.但是,我仍然想知道如果 html 表单需要物理地放置在服务器控件(需要服务器表单)之间,这将如何处理.

Update: I resolved my issue by simply moving the server form to the appropriate place on the page, rather than having it surround the entire page. However, I'm still wondering how this would be handled if the html form needed to be placed physically between server controls (which require the server form).

推荐答案

但是,我仍然想知道如果需要将 html 表单物理地放置在服务器控件(需要服务器表单)之间时将如何处理.

您可以在页面上放置控件而无需 HtmlForm.

You can place controls on your page without requiring an HtmlForm.

在您的情况下,声明另一个表单标记没有问题,但您也可以只在主表单上使用一些搜索控件并使其向该网站发出 GET.

In your case there's no issue declaring another form markup, but you could also just use some search control on your main form and make it issue a GET to that website.

这篇关于Asp.Net 嵌套表单的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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