Click here to Skip to main content
15,913,215 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
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
Posted

 
Share this answer
 
Comments
ankur789 8-Jun-13 5:34am    
first link i referred but there is a problem because i am using vb as default language so
HttpContext.Current("key") = me.textbox1.text

shows an error as
cannot be indexed beacause it has no default value
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))
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900