troubleshooting Question

Get Prompt Result in Server Side Code

Avatar of ankuratvb
ankuratvbFlag for United States of America asked on
ASP.NET
3 Comments1 Solution406 ViewsLast Modified:
Hi,

This is what i need.

I have a webform.When the user clicks a button,i need to ask the user for a value which i use for
furthur processing.

I need some way to get the value from the user and use it in my server side code. I tried using
InputBox but it gives me an error saying that to use inputbox i need to have a modal application
or use a service(smoething along these lines).

So,i tried using javascript's window.prompt and then trigger the server side event by generating a
button click when the user has entered a value.
So,i do:
perc=window.prompt("Enter Percentage Value:")
document.Form1.txtval.value=perc;
document.Form1.btn.click();

but the click statement gives me an error saying contentWindow.document is null or not an object.
i tried using Form1.btn.click() but still doesnt work.
If i remove the click statement, then the value is put in the textbox but i need an event to be triggered
to process furthur.

Can you help me in doing this?
Any Help would be greatly appreciated.
Thanx.
ASKER CERTIFIED SOLUTION
boulder_bum

Our community of experts have been thoroughly vetted for their expertise and industry experience.

Join our community to see this answer!
Unlock 1 Answer and 3 Comments.
Start Free Trial
Learn from the best

Network and collaborate with thousands of CTOs, CISOs, and IT Pros rooting for you and your success.

Andrew Hancock - VMware vExpert
See if this solution works for you by signing up for a 7 day free trial.
Unlock 1 Answer and 3 Comments.
Try for 7 days

”The time we save is the biggest benefit of E-E to our team. What could take multiple guys 2 hours or more each to find is accessed in around 15 minutes on Experts Exchange.

-Mike Kapnisakis, Warner Bros