Ask a Question related to ASP.NET General, Design and Development.
-
Halo #1
Value of an HTML element
I have a HTML text box (NOT a TextBox server control) in
a .aspx page and a button server control. Is it possible
with ASP.NET to get the value of the HTML text box when I
click the button? How can I get the value of an HTML
element from C# on the server?
Thanks!
Halo Guest
-
Handling HTML element events using AxWebBrowser
Hello, I am trying to hook into the events for HTML textboxes. In particular the onchange event. In the document complete handler I attach a... -
HTML::Element->right/->look_down lose, I need to walk the tree
Consider this HTML::Element dump of a simple HTML page: <html> @0 <head> @0.0 <title> @0.0.0 "HTML::Element test" <body> @0.1 <div> @0.1.0... -
How to *modify* text in HTML::Element
Sorry for the repost, I hit Send too soon. I am using HTML::TreeBuilder to futz with some HTML, and I need to modify the text of some of the... -
How to text in HTML::Element
I am using HTML::TreeBuilder to futz with some HTML, and I need to modify the text of some of the HTML::Elements. But I use can't find an easy way... -
[HTML::Element] how to read element by element
Hello I read the doc about HTML::Element, but I don't find how to read the tree create by parse() element by element. The doc says the tree looks... -
Karl Seguin #2
Re: Value of an HTML element
you could add a runat="server" to the input box
<input type="textbox" runat="server" id="yourinput" />
instead of bing a WebControls.TextBox it'll be an
HtmlControls.HtmlInputText
alternatively, you can always use Request.Form()...
Karl
"Halo" <fds@daf.asf> wrote in message
news:88fe01c3455f$8a07c300$a401280a@phx.gbl...> I have a HTML text box (NOT a TextBox server control) in
> a .aspx page and a button server control. Is it possible
> with ASP.NET to get the value of the HTML text box when I
> click the button? How can I get the value of an HTML
> element from C# on the server?
>
> Thanks!
Karl Seguin Guest
-
IbrahimMalluf #3
Re: Value of an HTML element
Set the HTML Textbox's Runat property to"Server". You will then be able to
access the value from C#
Ibrahim Malluf
"Halo" <fds@daf.asf> wrote in message
news:88fe01c3455f$8a07c300$a401280a@phx.gbl...> I have a HTML text box (NOT a TextBox server control) in
> a .aspx page and a button server control. Is it possible
> with ASP.NET to get the value of the HTML text box when I
> click the button? How can I get the value of an HTML
> element from C# on the server?
>
> Thanks!
IbrahimMalluf Guest
-
Kenn Ghannon #4
Re: Value of an HTML element
It is possible to do this, but you need to do a few things. First, set the
HTML textboxes runat=server. Then, declare the textbox in your code.
Include the following (as an example in C#):
using System.Web.UI.HtmlControls;
Now, inside of your class, you'll need to put something similar to this:
HtmlInputText myTextBox; // Make sure the name myTextBox is also the
name attribute of the HTML control
so your HTML code would look something like this:
<INPUT type="text" name="myTextBox" runat="server></INPUT>
"Halo" <fds@daf.asf> wrote in message
news:88fe01c3455f$8a07c300$a401280a@phx.gbl...> I have a HTML text box (NOT a TextBox server control) in
> a .aspx page and a button server control. Is it possible
> with ASP.NET to get the value of the HTML text box when I
> click the button? How can I get the value of an HTML
> element from C# on the server?
>
> Thanks!
Kenn Ghannon Guest



Reply With Quote

