This is a discussion on "Access a HTML InputBox through the Code-Page" within the ASP.NET Forum section. This forum, and the thread "Access a HTML InputBox through the Code-Page are both part of the Program Your Website category.
|
|
|
|
|
![]() |
||
Access a HTML InputBox through the Code-Page
|
||
| Notices |
![]() |
|
|
LinkBack | Thread Tools |
|
|||
|
Access a HTML InputBox through the Code-Page
I have a HTML control Inputbox:
<INPUT type="text" onkeyup="chkText(tester.value)" id="tester"> I want to access it through my codepage when I press a button PrivateSub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click Dim strMessage As HtmlInputText strMessage = Me.tester Dim strScript AsString = "<script language=JavaScript>alert('" & strMessage.Value & "');</script>" If (Not Page.IsStartupScriptRegistered("clientScript")) Then Page.RegisterStartupScript("clientScript", strScript) EndIf EndSub the error I get is: Object reference not set to an instance of an object. I want to keep the textbox client side validation because I check on every keyup. Is there any way to grab the text from the inputbox and use. Thanks Bob |
|
|
|
|||
|
Look at this example I have put together for you, it should help you out. It might also be of use to some other areas of your asp.net coding.
htmlcontrol.aspx
Last edited by u2orange; Nov 8th, 2005 at 13:15. |
|
|||
|
Re: Access a HTML InputBox through the Code-Page
Yes thanks, I could have sworn I tried it like that??
|
|
|||
|
Re: Access a HTML InputBox through the Code-Page
Have you got is sussed yet?
|
|
|||
|
Re: Access a HTML InputBox through the Code-Page
I think I see what my problem was. I was assuming that a web textbox was the same as a HTML textbox with "runat"=server. I now see that web textbox is stricly code-back page while HTML textbox can be seen in HTML script side and also code-back page.
|
![]() |
| Tags |
| access, html, inputbox, through, codepage |
| Thread Tools | |
|
|
Similar Threads
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| Is there a html code to make a page a certain size | allstar | Web Page Design | 4 | May 5th, 2008 20:25 |
| How to connect the microsoft access database using HTML page | mazenbluee | Databases | 5 | Nov 21st, 2007 06:49 |
| Display link code in html page | nate2099 | Web Page Design | 13 | Oct 11th, 2007 23:57 |
| Access into HTML | JTWork | Web Page Design | 3 | Feb 7th, 2007 07:05 |
| code error with Access | madhuri.t | Classic ASP | 1 | Feb 1st, 2006 17:47 |