Making a modal dialog w/an ASPX page?

A

A Traveler

Hello all,

Here is my situation... i have a page which has a dropdown of companies.
Next to it i have a "New" button for creating a new company. What i would
like to do is to show a modal dialog with the company entry screen, then
once it is dismissed, let the button continue with its postback and rebind
the companies dropdown to include the new company.

What i tried was to put in a javascript function in my html
function makeNewCompany(){
window.showModalDialog('/newCompanyDialog.aspx'); }

Then in my aspx.vb file, i put in
btnNewCompany.Attributes.Add("onclick", "javascript:makeNewCompany();")

This all would be fine, and works fine... up till the point at which from
the dialog i click the "Save" button. Then the aspx file tries to do its
postback which apparently does not work in a dialog window. Instead it winds
up creating a brand new IE window to process the postback.

Is there ANY way i can perform this kind of functionality within the ASP.NET
model? Is there perhaps some way in which i can do a "window.open" and make
it so that the btnNewCompany's postback will hold pending the release of
that other window in a modal sort of way?

Thanks in advance,

- Hitchhiker.
 
A

A Traveler

That worked absolutely perfectly!

Thank you very much, something so simple.
CheerZ!
 
E

Eliyahu Goldin

Open newCompanyDialog.aspx in HTML view and add a line <base target=_self>
in the head section.

Eliyahu
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,769
Messages
2,569,578
Members
45,052
Latest member
LucyCarper

Latest Threads

Top