从ASHX页面访问文本框的值 [英] Access textbox value from ashx page
问题描述
这是从母版页我的表单标签:
This is my Form Tag from The Master Page:
<表ID =form1的=服务器行动=Handler.ashx方法=POSTENCTYPE =的multipart / form-data的>
我有一个文本框
在我的内容页:
I have a TextBox
in my Content Page:
< ASP:文本框ID =TextBox1的=服务器>< / ASP:文本框>
我要访问在 Handler.ashx
页的文本框
值或发送文本框
值作为动作
属性像这样的查询字符串<表ID =form1的RUNAT =服务器行动=Handler.ashx textBoxVal = SOMETHING方法=POSTENCTYPE =的multipart / form-data的>
I want to access the TextBox
value in the Handler.ashx
page Or Send the TextBox
value as a query string in the action
attribute like this <form id="form1" runat="server" action="Handler.ashx?textBoxVal=SOMETHING" method="POST" enctype="multipart/form-data">
这可能吗?
推荐答案
我相信这个问题将在访问您的GenericHttpHandler文本框的ID(客户端ID或UniqueID的)。
I belive the problem would be accessing the ID (ClientID or UniqueID ) of your Text box in GenericHttpHandler.
但是,如果你设置的的ClientIDMode =静态作为一个TextBox属性,如果你使用它可能是可能的的 ASP.Net 4 的并尝试低于code
But it could be possible if you set the ClientIDMode="Static" as a TextBox Property, if you use ASP.Net 4 and try below code
context.Request.Params("TextBox1")
这篇关于从ASHX页面访问文本框的值的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!