views:

293

answers:

3

hi, i have a label in my form, and im trying to get the value of the label using HttpContext.Current.Request. But the label is not int he key, only the input types. is there any way of retrieving the value of a label?

Hello

Request["lbl1"] doesnt work.

A: 

Try HttpContext.Current.Request.Form["lbl1"]

Alfa
+1  A: 

you cannot get label values from request collection.

Textboxes, Dropdowns, checkboxes, radiobuttons, Listboxes can be accessed by request collection.

Canavar
+1  A: 

A label is not an HTML input type, so it would not be in the HttpRequest.

You could use JavaScript on the client to take the value of lbl1 and put it into a hidden form variable. But, you'd have to give more details on what you're trying to do to see if that's workable.

Mark Brackett