如何动态处理response.form集合中的项目? [英] how to process items in response.form collection dynamically?

查看:70
本文介绍了如何动态处理response.form集合中的项目?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

HI。在asp.net应用程序中,我有一个xmlDocument,我转换为客户端

html。使用xsl我创建了一些文本框来捕获用户输入。

中的每一个都与< data>相关。 xmlDoc中的元素。


我想使用Forms集合将html表单发布回

asp.net页面,并处理每个请求。表单对象(文本框)通过xml

node.value更新。


对于任何给定的xmlDocument,都会有未知数量的项目结果

在文本框中。但是,每个人都会通过他们的

属性获得一个唯一的名称,这就是我如何识别要更新的node.values。


内新的asp.net表单我发布了html表单,我将如何检索每个项目?
?我在为每个

声明考虑某种意见?但是如何动态地分配名称/值对等。


希望这很清楚!任何例子都赞赏。


谢谢。


Kathy


***通过Developersdex发送< a rel =nofollowhref =http://www.developersdex.comtarget =_ blank> http://www.developersdex.com ***

Don 只是参加USENET ......获得奖励!

HI. in asp.net app, I have an xmlDocument that I transform to the client
html. Using xsl I create a few textboxes to capture user input. Each of
these are related to <data> elements in the xmlDoc.

I want to use the Forms collection to post the html form back to an
asp.net page, and process each request.form object (textbox) via an xml
node.value update.

For any given xmlDocument there is an unknown number of items resulting
in textboxes. Each one would, however, have a unique name via their
attributes and that''s how I would identify the node.values to update.

Within the new asp.net form I post the html form to, how would I
retrieve each of the items? I''m thinking some kind of for each
statement? But how to assign the name/value pairs etc. dynamically.

Hope this is clear enough! Any examples appreciated.

Thanks.

Kathy

*** Sent via Developersdex http://www.developersdex.com ***
Don''t just participate in USENET...get rewarded for it!

推荐答案

我这样做了

dim i as简短


For i = 0 To Request.Form.Count - 1

Response.Write(Request.Form.Keys(i)&" = &&;& Request.Form.Item(i)&

"< / br>")

Next i


看到他们。看看你的想法

我认为你可以从这些代码中得到你需要的东西。


HTH


Shane

" Kathy Burke" < KA ********** @ attbi.com>在留言中写道

news:u9 ************** @ TK2MSFTNGP09.phx.gbl ...
I did this
dim i as short

For i = 0 To Request.Form.Count - 1
Response.Write(Request.Form.Keys(i) & "=" & Request.Form.Item(i) &
"</br>")
Next i

to see them. See what you think
You can get what you need out of this code I think.

HTH

Shane
"Kathy Burke" <ka**********@attbi.com> wrote in message
news:u9**************@TK2MSFTNGP09.phx.gbl...
HI。在asp.net应用程序中,我有一个xmlDocument,我转换为客户端
html。使用xsl我创建了一些文本框来捕获用户输入。这些中的每一个都与< data>有关。 xmlDoc中的元素。

我想使用Forms集合将html表单发布回
asp.net页面,并通过xml处理每个request.form对象(文本框)
node.value update。

对于任何给定的xmlDocument,文本框中都有未知数量的项目。
。但是,每个人都会通过他们的
属性拥有一个唯一的名称,这就是我如何识别要更新的node.values。

在新的asp.net表单中我发布html表单,我将如何检索每个项目?我在为每个
声明考虑某种意见?但是如何动态地分配名称/值对等。

希望这很清楚!任何例子都赞赏。

谢谢。

Kathy

***通过Developersdex发送 http://www.developersdex.com ***
不要只是参加USENET ......获得奖励!
HI. in asp.net app, I have an xmlDocument that I transform to the client
html. Using xsl I create a few textboxes to capture user input. Each of
these are related to <data> elements in the xmlDoc.

I want to use the Forms collection to post the html form back to an
asp.net page, and process each request.form object (textbox) via an xml
node.value update.

For any given xmlDocument there is an unknown number of items resulting
in textboxes. Each one would, however, have a unique name via their
attributes and that''s how I would identify the node.values to update.

Within the new asp.net form I post the html form to, how would I
retrieve each of the items? I''m thinking some kind of for each
statement? But how to assign the name/value pairs etc. dynamically.

Hope this is clear enough! Any examples appreciated.

Thanks.

Kathy

*** Sent via Developersdex http://www.developersdex.com ***
Don''t just participate in USENET...get rewarded for it!



谢谢Shane,


如何使用类似的东西创建一组名称/值对? (而不是回复写?)


例如,如果有三个名称/值对,请为每个名称/值分配一个var

名称/值,然后用它来设置一个xpath,然后使用该信息更新一个xml

节点。


我可以看到每个节点的帮助,但是你可以在你的例子中进一步说明




谢谢。


Kathy

***通过开发人员指南 http://www.developersdex.com 发送***

不要只是参加USENET ......获得奖励!
Thanks Shane,

How would I use something similar to create a set of name/value pairs
that I can then use in subsequent code? (instead of response write?)

For example, if there are three name/value pairs, assign a var
name/value to each one, then use it to set an xpath, then update an xml
node with that info.

I can see where the for each will help, but could you possibly go a bit
further in your example?

Thanks.

Kathy

*** Sent via Developersdex http://www.developersdex.com ***
Don''t just participate in USENET...get rewarded for it!


" Kathy Burke" < KA ********** @ attbi.com>在消息中写道

新闻:e9 ************* @ TK2MSFTNGP12.phx.gbl ...
"Kathy Burke" <ka**********@attbi.com> wrote in message
news:e9*************@TK2MSFTNGP12.phx.gbl...
谢谢Shane,
我如何使用类似的东西创建一组名称/值对
然后我可以在后续代码中使用? (而不是回复写?)
Thanks Shane,

How would I use something similar to create a set of name/value pairs
that I can then use in subsequent code? (instead of response write?)




Kathy,

System.Collections.Specialized.NameValueCollection适用于存储

名称/价值对。

-

John Saunders

互联网工程师
jo *********** @ surfcontrol.com


这篇关于如何动态处理response.form集合中的项目?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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