可以从html页面访问表格数据到aspx页面 [英] is accessing form data from a html page to aspx page is possible

查看:118
本文介绍了可以从html页面访问表格数据到aspx页面的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我设计了一个包含表单的html页面.现在,我想从该html页面检索该表单数据,并希望使用aspx页面将该数据存储到microsoft-sql数据库.是否有可能从该html页面到aspx页面访问数据.我也想在aspx页面中放置一个textarea(表单元素之一).

I have designed a page in html which contain form. now i want to retrieve that form data from that html page and i want store that data to microsoft-sql database using aspx page. Is it possible to access a data from that html page to aspx page. I also Want to place a textarea (one of form element) in aspx page is it possible

推荐答案

看,我认为您来自诸如Servlets,ASP之类的技术,其中只有通过表单操作才能从html页面获得表单数据.

在asp.net中,您可以在回发期间获取表单数据.它具有高级服务器端控件,甚至可以跟踪视图状态.我认为最好先学习Asp.net的基础知识,以便您知道在ASP.NET中处理这些基础有多容易.

除此之外,根据您的情况,很容易获得表单数据.只需以与使用表单动作对其他编程语言相同的方式发布页面,然后将其发布到您自己的HttpHandler (从IHttpHanler interface接口的一个界面)

您将从HttpContext.Current.Request.Form
获取所有表单数据 :)
See, I think you are coming from tech like Servlets, ASP somewhere, where the form data is available from an html page only with form action.

In asp.net you can get form data during postback. It has superior Server side controls that can track even viewstates. I think it is better to learn basics of Asp.net first so that you know how easy is to handle these in ASP.NET.

Other than that, in your situation, it is very easy to get form data. Just post the page, the same way you do for other programming language using form action, and post it to your own HttpHandler (one interfaced from IHttpHanler interface)

You will get all the form data from HttpContext.Current.Request.Form
:)


您无法从另一个页面的已发布页面获取表单数据.您可以获得的最接近的结果是使用两个ASPX页面的跨页面回发.很难根据您告诉我们的内容说更多.
You can''t get the form data from a page that has already been posted, from another page. The closest you can get is cross page postback using two ASPX pages. Hard to say more based on what you''ve told us.


您不需要在两者之间有一个ASPX页面.使用一个简单的类,该类将从HTML传递表单数据并将其插入SQL DB.

使用HTML或ASPX来获取数据,然后将其发布到DB.
You don''t need to have a ASPX page in between. Use a simple class that would pass on the form data from HTML and insert it into SQL DB.

Either use HTML or ASPX to get data and then post it to DB.


这篇关于可以从html页面访问表格数据到aspx页面的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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