Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chris Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Accept User Input Through an Input Box or Form

Status
Not open for further replies.

Tript99

Programmer
Dec 4, 2001
13
US
Hellow,
I'm working on a webform in VB.net and I would like the user to be able to click a button and have an input box pop up so they can input a string that will be later used in an sql statement. When I try to run my code I get errors saying:

An unhandled exception of type 'System.InvalidOperationException' occurred in Unknown Module.

Additional information: It is invalid to show a modal dialog or form when the application is not running in UserInteractive mode. Specify the ServiceNotification or DefaultDesktopOnly style to display a notification from a service application.

It sounds like there is no input box for VB.net. Can anyone tell me the best way to get around this? I'm thinking I might have to create another form and make it active when the button is clicked but I'm not sure how to do that either. I am trying to grind through this stuff without any proper training so any help would be awesome.

Here is my code:

Private sub ManualSearch_Click
Dim strSearch As String
strSearch = funInputBox(strMessage)
End Sub

Function funInputBox(ByVal strMessage As String) As String
Dim message, title, defaultValue As String
Dim myValue As Object
title = "Manual Product Search" ' Set title.
funInputBox = InputBox(message, title, defaultValue)
End Function


Thanks,
Tript.
 
you probably created a service application instead of a windowsapplication.

Christiaan Baes
Belgium

I just like this --> [Wiggle] [Wiggle]
 
Hmm.. I'm not sure what that means. I'm trying to create a web based app. What is the difference?
 
I'm trying to create a web based app. What is the difference?
Well, a web-based app runs on the Internet and users access it through a web browser. A VB.NET desktop application (what this forum is for) is a program that runs locally on the users machine (and InputBox is a Windows Forms class and as such can't be used in a web based app).

If you want to create pop up boxes for an ASP.NEt application then you will have to use javascript or another client side language.


____________________________________________________________

Need help finding an answer?

Try the Search Facility or read FAQ222-2244 on how to get better results.

 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top