Want to win a PS4? Go Premium and enter to win our High-Tech Treats giveaway. Enter to Win

x
?
Solved

Java input box and asp.net

Posted on 2004-10-29
5
Medium Priority
?
1,566 Views
Last Modified: 2008-01-09
Should be easy or so I've been told..  : )

What I'm looking for is...

I have an asp.net  button on a page, I want a popup input box to show when the button is pressed
and the ablity to read the users inout into my asp.net code... ie: (vb example)

button.click
Dim mystring as string = inputbox("enter some text")

now I want to be able to work with "mystring" in the asp.net code.

Thanks!
0
Comment
Question by:flosoft
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 2
  • 2
5 Comments
 
LVL 11

Expert Comment

by:pratap_r
ID: 12448546
add this to your page_load

assuming you have a aspbutton which will postback the form and is named button1
button1.AddAttribute("onclick","hdnctrl.value=prompt('enter some text','default value');")

assuming you have a hidden control called hdnctrl

now the button click event should be able to access hdnctrl's value as the user entered input

easy right?

Have Fun
Pratap
0
 

Author Comment

by:flosoft
ID: 12448691
where do I put that code?... the asp button also has an onclick event in the .vb file...

hopefully ez...
0
 
LVL 11

Accepted Solution

by:
pratap_r earned 500 total points
ID: 12450899
button1.AddAttribute("onclick","hdnctrl.value=prompt('enter some text','default value');")

will go in your page_load
0
 
LVL 3

Expert Comment

by:harry_hendrata
ID: 12452573
Either what pratap_r said, or you could have a hidden layer on your html with the code, then display when the button is clicked..
0
 

Author Comment

by:flosoft
ID: 12452693
Thanks!!
0

Featured Post

What does it mean to be "Always On"?

Is your cloud always on? With an Always On cloud you won't have to worry about downtime for maintenance or software application code updates, ensuring that your bottom line isn't affected.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

If you’re thinking to yourself “That description sounds a lot like two people doing the work that one could accomplish,” you’re not alone.
The SignAloud Glove is capable of translating American Sign Language signs into text and audio.
Introduction to Processes
Starting up a Project

618 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question