Wrox Programmer Forums
|
ASP.NET 1.0 and 1.1 Basics ASP.NET discussion for users new to coding in ASP.NET 1.0 or 1.1. NOT for the older "classic" ASP 3 or the newer ASP.NET 2.0.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the ASP.NET 1.0 and 1.1 Basics section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
 
Old March 22nd, 2006, 10:40 AM
Wrox Author
 
Join Date: Oct 2005
Posts: 4,104
Thanks: 1
Thanked 64 Times in 64 Posts
Send a message via AIM to dparsons
Default Javascript Problem

Hey all,
    I am working on an application and I need to have an enabled textbox that you can't edit. The reason is is that when you disable a Webcontrol or set its visiblity to False its value does not get inserted into the HTTP Request the same holds true for the HTMLInputControl.

The problem here is that, after the page is posted, it will not go through the asp life cycle (im pulling the request straight out of the HTTP Pipeline, processing my data, then redirecting) and I cannot use "Request" in anyway (Calling Request cause's the entire HTTP Request to be loaded into Server Memory, exactly what i am trying to avoid) because it would circumvent what I am trying to do.

Here is what im trying to solve, this app is going to be on an intranet, when a network user goes to the page i need to grab their username calling Request.ServerVariables("Remote_User") and placing that value in a text box (Calling request on initial page load is ok, it is after the page is posted that this cannot be done)

Obviously, I do not want this value altered in anyway. The short coming of this is if the user disables Javascript in their browser, but only users with Admin rights have the right to make those changes to their system.

When it comes to JavaScript my skills are a little shakey but what I was thinking was something like this:

When txtID onfocus == true alert('Message'); [move focus to the next form control]

Is there an eaiser way to do this or would the above logic suffice?

"The one language all programmers understand is profanity."
__________________
===============================================
Doug Parsons
Wrox online library: Wrox Books 24 x 7
Did someone here help you? Click on their post!
"Easy is the path to wisdom for those not blinded by themselves."
===============================================
 
Old March 22nd, 2006, 01:40 PM
Authorized User
 
Join Date: Mar 2006
Posts: 31
Thanks: 0
Thanked 0 Times in 0 Posts
Default

Instead of looking for javascript, how about setting the 'readonly' property of the text box to 'True' as soon as you write the value to the textbox.

Regards,
Sai Puli.

 
Old March 22nd, 2006, 01:41 PM
Wrox Author
 
Join Date: Oct 2005
Posts: 4,104
Thanks: 1
Thanked 64 Times in 64 Posts
Send a message via AIM to dparsons
Default

And sometimes the most obivous answer is yet overlooked, thanks bill.

"The one language all programmers understand is profanity."





Similar Threads
Thread Thread Starter Forum Replies Last Post
Javascript Problem suresh_accudocs ASP.NET 1.0 and 1.1 Professional 1 July 24th, 2007 06:04 PM
problem with javascript padmaja3 Other Programming Languages 0 February 8th, 2007 02:56 AM
javascript problem dk6607 ASP.NET 1.0 and 1.1 Basics 10 October 2nd, 2006 12:56 PM
JavaScript Problem @shish ASP.NET 1.0 and 1.1 Basics 1 April 3rd, 2006 10:26 AM
Javascript problem highcliffevillage Javascript How-To 0 July 8th, 2004 07:13 AM





Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.