Solved

Java input box and asp.net

Posted on 2004-10-29
1,499 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
Question by:flosoft
    5 Comments
     
    LVL 11

    Expert Comment

    by:pratap_r
    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
    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:
    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
    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
    Thanks!!
    0

    Write Comment

    Please enter a first name

    Please enter a last name

    We will never share this with anyone.

    Featured Post

    Course: MongoDB Object-Document Mapper for NodeJS

    NodeJS (JavaScript on the server) is awesome, but some developers get confused about NoSQL when it comes to working in Node with MongoDB (NoSQL database). Do you need a better explanation of how to use Node.js with MongoDB? The most popular choice is the Mongoose library.

    Suggested Solutions

    This article is meant to give a basic understanding of how to use R Sweave as a way to merge LaTeX and R code seamlessly into one presentable document.
    A short article about problems I had with the new location API and permissions in Marshmallow
    An introduction to basic programming syntax in Java by creating a simple program. Viewers can follow the tutorial as they create their first class in Java. Definitions and explanations about each element are given to help prepare viewers for future …
    In this fifth video of the Xpdf series, we discuss and demonstrate the PDFdetach utility, which is able to list and, more importantly, extract attachments that are embedded in PDF files. It does this via a command line interface, making it suitable …

    856 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

    Need Help in Real-Time?

    Connect with top rated Experts

    11 Experts available now in Live!

    Get 1:1 Help Now