Problem solve Get help with specific problems with your technologies, process and projects.

Creating a generic search facility

I want to create a generic search facility in my ASP.NET project, using VB.NET as the code-behind. On certain fields in my main page, I would like to create a popup window, displaying a dataset in a datagrid control for the user to select from. After a record in the grid has been highlighted, I want to close the popup window and send a field from the datagrid control back to a textbox in my main aspx page.

I don't want to use the Response.Redirect method because it only redirects to another "main" page and will not have the look and feel of a popup. I have read about the windo.open method using java script in client-side scripting which I execute correctly now with embedded code in the code-behind of my main aspx page.

The problem is to create a datagrid control on a popup window. Should I put a datagrid control on an aspx page, load it with a dataset and then load it in the window.open method? What are your suggestions? I would like to keep all code in the code-behind if possible, will just ease future maintenance. Would appreciate any help.
You're on the right track! You just have to call window.open pointing to an aspx file that contains the datagrid. Of course, you could pass querystring parameters to customize the grid depending on selection on the "main" page. When the row the user is interested in is selected or clicked, you can easily plug a little javascript to set a variable on the parent window (window.parent) that will help it identify the selected value, or even directly modify the textbox, and after that, just call window.close() to close the popup.

Dig Deeper on Win Development Resources

Have a question for an expert?

Please add a title for your question

Get answers from a TechTarget expert on whatever's puzzling you.

You will be able to add details on the next page.

Start the conversation

Send me notifications when other members comment.

Please create a username to comment.