Thursday, March 29, 2012
server side kepress event on textbox
I have a webform and I am wanting to call a function from a textbox control
located on the webform when a key is pressed. Can this be done in server sid
e.
already know do like this
on ASPX page within javascript tags
<script laguage=javascript>
function trapKeypress() {
alert (window.event.keyCode);
}
</script>
and in .vb page of the .aspx page ..'
textbox1.attributes.item("onkeypress") = "javascript:trapKeypress();"
Can I do it without using JavaScript .
RegardsYou can submit the form in trapKeypress(). This will cause a postback and
you can pass to the server a sort of info telling what exactly caused the
postback. This will resemble a server event. You can't avoid using
javascript on the client side. How can server know what is happening in the
browser?
Eliyahu
"Raed Sawalha" <RaedSawalha@.discussions.microsoft.com> wrote in message
news:1D18DAD2-5F54-4F85-8E27-8F63BB1F3B7E@.microsoft.com...
> HI There,
> I have a webform and I am wanting to call a function from a textbox
control
> located on the webform when a key is pressed. Can this be done in server
side.
> already know do like this
> on ASPX page within javascript tags
> <script laguage=javascript>
> function trapKeypress() {
> alert (window.event.keyCode);
> }
> </script>
> and in .vb page of the .aspx page ..'
> textbox1.attributes.item("onkeypress") = "java script:trapKeypress();"
> Can I do it without using JavaScript .
> Regards
server side kepress event on textbox
I have a webform and I am wanting to call a function from a textbox control
located on the webform when a key is pressed. Can this be done in server side.
already know do like this
on ASPX page within javascript tags
<script laguage=javascript>
function trapKeypress() {
alert (window.event.keyCode);
}
</script
and in .vb page of the .aspx page ..'
textbox1.attributes.item("onkeypress") = "javascript:trapKeypress();"
Can I do it without using JavaScript .
RegardsYou can submit the form in trapKeypress(). This will cause a postback and
you can pass to the server a sort of info telling what exactly caused the
postback. This will resemble a server event. You can't avoid using
javascript on the client side. How can server know what is happening in the
browser?
Eliyahu
"Raed Sawalha" <RaedSawalha@.discussions.microsoft.com> wrote in message
news:1D18DAD2-5F54-4F85-8E27-8F63BB1F3B7E@.microsoft.com...
> HI There,
> I have a webform and I am wanting to call a function from a textbox
control
> located on the webform when a key is pressed. Can this be done in server
side.
> already know do like this
> on ASPX page within javascript tags
> <script laguage=javascript>
> function trapKeypress() {
> alert (window.event.keyCode);
> }
> </script>
> and in .vb page of the .aspx page ..'
> textbox1.attributes.item("onkeypress") = "javascript:trapKeypress();"
> Can I do it without using JavaScript .
> Regards
Monday, March 26, 2012
Server tag not well formed error.
But when I drop the control in the webform, set the properties, go to html view, then back to design view. I get a gray box where my custom control was that says "Error Creating Custom Control" and then a message of "Server Tag is not well formed".
Anyone know why this would happen?
Here is how it looks in HMTL view from within the IDE.
<JHA:JHAImageRollover id="JHAImageRollover1" onclick="http://www.google.com" runat="server" BaseImage="/common/images/btn_search.gif" RolloverImage="/common/images/btn_cancel.gif"></JHA:JHAImageRollover>Is there are <@.Register > tag on the top of the .aspx page that the control is on?
My guess is the page doesn't know anything about the control since its library is not registered with the page.
<%@. Register TagPrefix="jh1" Namespace="YourControlLibraryNamespace" Assembly="YourControlLibrary" %>
Got it fixed...strange though.
The TagPrefix in the page directive was "jha"
it was yelling because the control had "JHA"
go figure!?