mixing HTML controls with code behind controls

  • Thread starter Norm via DotNetMonster.com
  • Start date
N

Norm via DotNetMonster.com

I had a similar problem as Ferdi - 19 Aug 2003 - "Postback after carriage
return input" where pressing the enter key would postback my asp textboxes
prematurely - I want the user to click on a button after filling in the
text boxes and pressing enter messes up my plans. Using Giscard's advice
(onkeydown="return event.keyCode!=13")with HTML Input text boxes solved the
postback problem. But now I'm stuck trying to get the text from the HTML
text boxes back into my asp C# code.

Thanks,

Norm
 
E

Elton W

Hi Norm,

If you assign HTML text control's properties runat=server
and id, e.g. htmlTxtInput, then you can deal with the
control pretty similar to server text control:

string inputValue = this.HtmlTxtInput.Value; // server
control's value is .Text.

HTH

Elton Wang
(e-mail address removed)
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,755
Messages
2,569,537
Members
45,022
Latest member
MaybelleMa

Latest Threads

Top