473,569 Members | 2,412 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="ret urn 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 1542
Request["myhtmlcontroln ame"].ToString()

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

"Norm via DotNetMonster.c om" <fo***@nospam.D otNetMonster.co m> wrote in
message news:43******** *************** *******@DotNetM onster.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="ret urn 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.HtmlTxtInp ut.Value; // server
control's value is .Text.

HTH

Elton Wang
el********@hotm ail.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="re turn 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
1422
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 VB.net based Server-controls with VB.Net code behind. I would like to convert the JScript to JScript.net Server-controls with JScript.net code...
2
8377
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 submitting the form to update the database. The server doesn't have the client side value any more. It seems to me that as I begin to write the...
12
1722
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 ASPX interaction? How would I best build such pages. Many people of course don't want a page that they can't modify at all without programmer...
6
5485
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; DataBinder.Eval(Container.DataItem,"StoreEmail") &amp; "&amp;Subject=" &amp; DataBinder.Eval(Container.DataItem,"ProductName") ....
5
6527
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 behind a(simply bcaz it is not recognized in the code behind IDE) and it does not make a server trip. HTML server Controls should be preferred over...
5
3576
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 that for server control component , code is running on the server side. But if I take as example a Label. I place on a webform an HTM label...
5
1519
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 I access an html field from ASP.net? Or better yet, how do I access server controls from javascript? The latter would be possible if ASP.net always...
4
1603
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
3463
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 search page, consisting of a table where each row has (in this order): - checkbox – to indicate whether to return the column - label - textbox...
0
7703
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, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main...
0
7618
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language...
0
7926
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. ...
0
7983
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 protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the...
0
6287
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then...
0
5223
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 then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert...
0
3647
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
2117
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 we have to send another system
1
1228
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

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.