从ASHX页面访问文本框的值 [英] Access textbox value from ashx page

查看:462
本文介绍了从ASHX页面访问文本框的值的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

这是从母版页我的表单标签:

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屋!

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