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.
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.