Groups | Blog | Home
all groups > asp.net > may 2005 >

asp.net : mixing HTML controls with code behind controls


Elton W
5/9/2005 6:12:23 PM
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
elton_wang@hotmail.com


[quoted text, click to view]
Robbe Morris [C# MVP]
5/9/2005 8:22:29 PM
Request["myhtmlcontrolname"].ToString()

--
2004 and 2005 Microsoft MVP C#
Robbe Morris
http://www.robbemorris.com
http://www.masterado.net



"Norm via DotNetMonster.com" <forum@nospam.DotNetMonster.com> wrote in
message news:43e5b867799d4646b11eccdeebb9edb9@DotNetMonster.com...
[quoted text, click to view]

Norm via DotNetMonster.com
5/9/2005 11:16:01 PM
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 via DotNetMonster.com
5/10/2005 2:39:14 PM
Robbe,

This is exactly what I needed! Thanks!

Norm

--
AddThis Social Bookmark Button