473,508 Members | 2,441 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

mixing HTML controls with code behind controls

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
Nov 19 '05 #1
3 1537
Request["myhtmlcontrolname"].ToString()

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

"Norm via DotNetMonster.com" <fo***@nospam.DotNetMonster.com> wrote in
message news:43******************************@DotNetMonste r.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

Nov 19 '05 #2
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
el********@hotmail.com

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

Thanks,

Norm
.

Nov 19 '05 #3
Robbe,

This is exactly what I needed! Thanks!

Norm

--
Message posted via http://www.dotnetmonster.com
Nov 19 '05 #4

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

2
1405
by: junk | last post by:
I am converting a large website with VBScript include files and JScript also included as <script language="jscript" runat="server"> in other include files. I would like to convert the VBScript to...
2
8374
by: Hazzard | last post by:
I just realized that the code I inherited is using all asp.net server controls (ie. webform controls) and when I try to update textboxes on the client side, I lose the new value of the textbox when...
12
1716
by: SStory | last post by:
Doing pages for contract..... If I make an ASPX file that does certain things, how simple would it be for a person who know nothing about it to modify the user interface without bothering the...
6
5476
by: Paolo Pignatelli | last post by:
I have an aspx code behind page that goes something like this in the HTML view: <asp:HyperLink id=HyperLink1 runat="server" NavigateUrl='<%#"mailto:" &amp;...
5
6521
by: siaj | last post by:
Hello All, Can any one give me a clue when to use Web Server controls/ HTML server controls/HTML Controls. As I understand .. HTML controls should be used if u dont need to refer it in the code...
5
3565
by: serge calderara | last post by:
Dear all, I am new in asp.net and prepare myself for exam I still have dificulties to understand the difference between server control and HTML control. Okey things whcih are clear are the fact...
5
1513
by: Shawn Repphan | last post by:
I have a webform with about 20 html textboxes and checkboxes. I am using ICallbackEventHandler to page through these successfully. But I need to be able to accept changes from these fields. How can...
4
1597
by: miladhatam | last post by:
can i mix the code behind page variables with html source ? for examle in asp we insert <% %> i want to connect to my db and with response.write , show it in a table thanks
1
3451
by: bradwoody | last post by:
ASP.Net and C# I am having trouble determining how to manipulate html controls via javascript AND access those same controls in the C# code behind. Here's the scoop: I am making an advanced...
0
7223
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
7488
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
1
5045
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...
0
4702
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and...
0
3191
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The...
0
3179
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
0
1544
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated ...
1
762
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
0
412
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.