473,387 Members | 1,541 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,387 software developers and data experts.

textbox lost focus in aspnet

I would like to get a lostfocus even in aspnet, I know I can do
something like that:

txtBox.Attributes.Add("onblur", "javascript:RunMe()")

But then the scirpt, RunMe has to be written in the html page, which
can be viewed by the user.

I want to keep the code in the aspx.vb (hiding the code from the
user), as I am going to retreive some data from the database, then....

1. Can the function or sub be placed at aspx.vb? If yes, how can I
call the function
2. If not, how can I hide my code from the user, as they can user
"View Source"...

Thanks in advance. Any help would be greatly appreciated
Wanda
Nov 18 '05 #1
1 8219
Hi Wanda,

You know, there's a fish named afer you. ;-)

I believe you're mixing up server-side and client-side functionality here.
Your HTML document on the client is your interface. The classes and
processing on the server are the business logic. When you say:
I want to keep the code in the aspx.vb (hiding the code from the
user), as I am going to retreive some data from the database, then....
You're mixing up server-side and client-side functionality. Fetching data
from a database is something that happens on the server, where nobody can
see it. Anything that ahppens on the client, such as handling an HTML
object's onblur event, is purely interface stuff. There isn't any logical
connection between the 2. How is running a client-side event handler going
to expose something you don't want exposed from the server?

At any rate, client-side event handling is on the client, and must be done
via JavaScript, which must be downloaded by the browser. Once downloaded,
there's little you can do to hide it from the user. You could put your
JavaScript functions into a .js file which you reference in your page, but
of course, that .js file is downloaded by the browser as well (or it
couldn't run it), and is therefore, available with a little work on the part
of the user, digging around in their Temporary Internet Files folder.

Bottom line: Hiding your HTML source code is a pointless and fruitless
endeavor. The server-side code will never be seen by the client anyway, and
that is what really matters.

--
HTH,
Kevin Spencer
..Net Developer
Microsoft MVP
Neither a follower
nor a lender be.

"Wanda" <wa*****@rogers.com> wrote in message
news:11************************@posting.google.com ... I would like to get a lostfocus even in aspnet, I know I can do
something like that:

txtBox.Attributes.Add("onblur", "javascript:RunMe()")

But then the scirpt, RunMe has to be written in the html page, which
can be viewed by the user.

I want to keep the code in the aspx.vb (hiding the code from the
user), as I am going to retreive some data from the database, then....

1. Can the function or sub be placed at aspx.vb? If yes, how can I
call the function
2. If not, how can I hide my code from the user, as they can user
"View Source"...

Thanks in advance. Any help would be greatly appreciated
Wanda

Nov 18 '05 #2

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

Similar topics

0
by: Carlos Lozano | last post by:
Hello everybody, I Have a piece of code for a Pocket PC that has a disabled and hidden textbox control at startup. It is enabled and set visible programatically. The cursor is captured calling...
13
by: Paul Slavin | last post by:
I have a textbox bound to a dataview, when I update the text in the textbox no changes take place in the underlying dataset. Why is this?? any answers appreciated, as to due to the underlying...
5
by: Steve S | last post by:
Heres what I want to do...User types into a texbox, clicks a button, the button saves that text to a file. The problem is that when I click the submit button, any changes made to the textbox are...
0
by: Wanda | last post by:
I would like to get a lostfocus even in aspnet, I know I can do something like that: txtBox.Attributes.Add("onblur", "javascript:RunMe()") But then the scirpt, RunMe has to be written in the...
6
by: Ellis Yu | last post by:
Hi all, I've a form containing some textbox fields. I wrote a simple code to check if the field is blank in lost focus event, an msg box will be shown to remind user about it. But don't why the...
2
by: Agnes | last post by:
When the textbox 's Enabled = True, (its backcolor is white) When the Textbox got focus (backcolor change to pink by my code) when the textbox lost focus(back color change to white by my code)...
1
by: D. Shane Fowlkes | last post by:
I have a asp:textbox which I've applied a javascript function to strip off all non-numeric chanarcters. The js function is triggered with the textbox's onblur attribute. I also have a...
0
by: =?Utf-8?B?Qw==?= | last post by:
Hi, I have a series of textboxes on an aspx page. These textboxes are within an UpdatePanel. On the OnTextChanged Event of each textbox I do some calculations in my codebehind and update...
3
by: viral123 | last post by:
Hi all, does any one know how to get the functionality of get focus and lost focus using ASP.Net like VB.Net I want to change the textbox back ground color when it has the focus. I used...
10
by: moondaddy | last post by:
I have a textbox on a webform and based on certain conditions I wanted to prevent a user from editing its text. I dont like the look of the texbox when its disabled and was wondering if there is a...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
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...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...

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.