N K N K - 2 years ago 70
HTML Question

Not getting Input text value in code behind

I want to use the value of the

which is input
in one of my query. SO I tried like below

string strInwardNO = Request.Form["TxtIwNo"];

and HTML is

<input id="TxtIwNo" type="text" runat="server" disabled="disabled" />

but I am not getting value. What is wrong here

When I check while debugging, I always get it as NULL

Answer Source

In order to input field value was posted to your backend it cannot be disabled. Change it to readonly and style it to look like disabled:

input[readonly] { 
    background: #CCC; 
    color: #333; 
    border: 1px solid #666 
Recommended from our users: Dynamic Network Monitoring from WhatsUp Gold from IPSwitch. Free Download