获取ashx文件中的文本框值 [英] get textbox value in the ashx file

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

问题描述

亲爱的先生/女士





i我的网页上有一个文本框。这是为了学生卷号。

先生我想通过这个卷号来获取图像我使用的是.ashx处理程序



先生我怎样才能传递此文本框值.ashx处理程序帮助我这个

dear sir/ma'am


i have a textbox in my web form .which is for student roll no.
sir i want to get image through this roll no for which i uses .ashx handler

sir how can i pass this text box value in the .ashx handler help me for this

推荐答案

请参阅..

使用通用处理程序(.ashx)页面 [ ^ ]

http://www.devcurry.com/2010/11/call-aspnet-handler-ashx-using.html [ ^ ]
See..
working with generic Handler (.ashx ) page[^]
http://www.devcurry.com/2010/11/call-aspnet-handler-ashx-using.html[^]


转换textbo x val到base64并通过查询字符串参数传递给处理程序:



1.从您的aspx页面:



MyImage.ImageUrl =〜/ myHandler.ashx?data =+ Convert.ToBase64String(System.Text.Encoding.UTF8.GetBytes(MyTextBox.Text))



2.在你的处理程序中:



Dim textBase64 As String = context.Request(data)



Dm text As String = System.Text.Encoding.UTF8.GetString(Convert.FromBase64String(textBase64))
Convert the textbox val to base64 and pass it to the handler through a query string param:

1. From your aspx page:

MyImage.ImageUrl = "~/myHandler.ashx?data=" + Convert.ToBase64String(System.Text.Encoding.UTF8.GetBytes(MyTextBox.Text))

2. In your handler:

Dim textBase64 As String = context.Request("data")

Dm text As String = System.Text.Encoding.UTF8.GetString(Convert.FromBase64String(textBase64))


这篇关于获取ashx文件中的文本框值的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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