473,811 Members | 4,050 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Open modal dialog

If I want to open a new ASPX page when the user clicks on a button
do I use JS for that?
What would be a point of having AutoPostBack enabled for that button
if I cannot use server side to open a new form anyway.
How do I attach a JS to the button's click?
How do I attach a JS to the toolbar button's click?

Thanks
Nov 18 '05 #1
7 4315
Hi Mr. Goldin,

All you need to do is attach an 'OnClick' client side attribute using the
Attributes collection of the control.
Then use a JS file or script that will open the modal dialog.

"Mark Goldin" <ma********@com cast.net> wrote in message
news:%2******** ********@tk2msf tngp13.phx.gbl. ..
If I want to open a new ASPX page when the user clicks on a button
do I use JS for that?
What would be a point of having AutoPostBack enabled for that button
if I cannot use server side to open a new form anyway.
How do I attach a JS to the button's click?
How do I attach a JS to the toolbar button's click?

Thanks

Nov 18 '05 #2
As Mr. Dot.Net suggested, use JS and the OnClick attribute. If all you
wanted to do was open a new window, then you dont need to enable
Auto-Postback as its all client side via JS. If you want to do some form of
server side processing, then would need to Postback as well so the server
can process what you want it to do.

--
- Paul Glavich
Microsoft MVP - ASP.NET
"Mr. Dot Net" <Do@Not.Spam> wrote in message
news:O9******** ******@TK2MSFTN GP09.phx.gbl...
Hi Mr. Goldin,

All you need to do is attach an 'OnClick' client side attribute using the
Attributes collection of the control.
Then use a JS file or script that will open the modal dialog.

"Mark Goldin" <ma********@com cast.net> wrote in message
news:%2******** ********@tk2msf tngp13.phx.gbl. ..
If I want to open a new ASPX page when the user clicks on a button
do I use JS for that?
What would be a point of having AutoPostBack enabled for that button
if I cannot use server side to open a new form anyway.
How do I attach a JS to the button's click?
How do I attach a JS to the toolbar button's click?

Thanks


Nov 18 '05 #3
Can a new form be pushed from the server?

"Paul Glavich [MVP - ASP.NET]" <gl**@aspallian ce.com-NOSPAM> wrote in
message news:uw******** ******@TK2MSFTN GP10.phx.gbl...
As Mr. Dot.Net suggested, use JS and the OnClick attribute. If all you
wanted to do was open a new window, then you dont need to enable
Auto-Postback as its all client side via JS. If you want to do some form of server side processing, then would need to Postback as well so the server
can process what you want it to do.

--
- Paul Glavich
Microsoft MVP - ASP.NET
"Mr. Dot Net" <Do@Not.Spam> wrote in message
news:O9******** ******@TK2MSFTN GP09.phx.gbl...
Hi Mr. Goldin,

All you need to do is attach an 'OnClick' client side attribute using the Attributes collection of the control.
Then use a JS file or script that will open the modal dialog.

"Mark Goldin" <ma********@com cast.net> wrote in message
news:%2******** ********@tk2msf tngp13.phx.gbl. ..
If I want to open a new ASPX page when the user clicks on a button
do I use JS for that?
What would be a point of having AutoPostBack enabled for that button
if I cannot use server side to open a new form anyway.
How do I attach a JS to the button's click?
How do I attach a JS to the toolbar button's click?

Thanks



Nov 18 '05 #4
Here is a code I am using:
this.Toolbar1.A ttributes.Add(" onclick", "executeClick() ");

In HEAD section on my aspx page I have:

<script language="javas cript" src="script.js" ></script>

script.js has a function executeClick().

when I click on a toolbar's button I am getting an error:

"Object expected".

Any idea?

"Mr. Dot Net" <Do@Not.Spam> wrote in message
news:O9******** ******@TK2MSFTN GP09.phx.gbl...
Hi Mr. Goldin,

All you need to do is attach an 'OnClick' client side attribute using the
Attributes collection of the control.
Then use a JS file or script that will open the modal dialog.

"Mark Goldin" <ma********@com cast.net> wrote in message
news:%2******** ********@tk2msf tngp13.phx.gbl. ..
If I want to open a new ASPX page when the user clicks on a button
do I use JS for that?
What would be a point of having AutoPostBack enabled for that button
if I cannot use server side to open a new form anyway.
How do I attach a JS to the button's click?
How do I attach a JS to the toolbar button's click?

Thanks


Nov 18 '05 #5
I guess you misswritten the js.
"Mark Goldin" <ma********@com cast.net> wrote in message
news:uf******** ******@TK2MSFTN GP12.phx.gbl...
Here is a code I am using:
this.Toolbar1.A ttributes.Add(" onclick", "executeClick() ");

In HEAD section on my aspx page I have:

<script language="javas cript" src="script.js" ></script>

script.js has a function executeClick().

when I click on a toolbar's button I am getting an error:

"Object expected".

Any idea?

"Mr. Dot Net" <Do@Not.Spam> wrote in message
news:O9******** ******@TK2MSFTN GP09.phx.gbl...
Hi Mr. Goldin,

All you need to do is attach an 'OnClick' client side attribute using the Attributes collection of the control.
Then use a JS file or script that will open the modal dialog.

"Mark Goldin" <ma********@com cast.net> wrote in message
news:%2******** ********@tk2msf tngp13.phx.gbl. ..
If I want to open a new ASPX page when the user clicks on a button
do I use JS for that?
What would be a point of having AutoPostBack enabled for that button
if I cannot use server side to open a new form anyway.
How do I attach a JS to the button's click?
How do I attach a JS to the toolbar button's click?

Thanks



Nov 18 '05 #6
The way we described you earlier is the way you need.
Though if for some reason you want to 'push' modal from the server you can
just registerstartup script that will do that for you.
"Mark Goldin" <ma********@com cast.net> wrote in message
news:ug******** ******@TK2MSFTN GP10.phx.gbl...
Can a new form be pushed from the server?

"Paul Glavich [MVP - ASP.NET]" <gl**@aspallian ce.com-NOSPAM> wrote in
message news:uw******** ******@TK2MSFTN GP10.phx.gbl...
As Mr. Dot.Net suggested, use JS and the OnClick attribute. If all you
wanted to do was open a new window, then you dont need to enable
Auto-Postback as its all client side via JS. If you want to do some form

of
server side processing, then would need to Postback as well so the server
can process what you want it to do.

--
- Paul Glavich
Microsoft MVP - ASP.NET
"Mr. Dot Net" <Do@Not.Spam> wrote in message
news:O9******** ******@TK2MSFTN GP09.phx.gbl...
Hi Mr. Goldin,

All you need to do is attach an 'OnClick' client side attribute using

the Attributes collection of the control.
Then use a JS file or script that will open the modal dialog.

"Mark Goldin" <ma********@com cast.net> wrote in message
news:%2******** ********@tk2msf tngp13.phx.gbl. ..
> If I want to open a new ASPX page when the user clicks on a button
> do I use JS for that?
> What would be a point of having AutoPostBack enabled for that button
> if I cannot use server side to open a new form anyway.
> How do I attach a JS to the button's click?
> How do I attach a JS to the toolbar button's click?
>
> Thanks
>
>



Nov 18 '05 #7
Well, same function copied into aspx page works fune.
It looks like it does not load the js file. What would be the reason of
this?

"Mr. Dot Net" <Do@Not.Spam> wrote in message
news:Ok******** ******@TK2MSFTN GP12.phx.gbl...
I guess you misswritten the js.
"Mark Goldin" <ma********@com cast.net> wrote in message
news:uf******** ******@TK2MSFTN GP12.phx.gbl...
Here is a code I am using:
this.Toolbar1.A ttributes.Add(" onclick", "executeClick() ");

In HEAD section on my aspx page I have:

<script language="javas cript" src="script.js" ></script>

script.js has a function executeClick().

when I click on a toolbar's button I am getting an error:

"Object expected".

Any idea?

"Mr. Dot Net" <Do@Not.Spam> wrote in message
news:O9******** ******@TK2MSFTN GP09.phx.gbl...
Hi Mr. Goldin,

All you need to do is attach an 'OnClick' client side attribute using the Attributes collection of the control.
Then use a JS file or script that will open the modal dialog.

"Mark Goldin" <ma********@com cast.net> wrote in message
news:%2******** ********@tk2msf tngp13.phx.gbl. ..
> If I want to open a new ASPX page when the user clicks on a button
> do I use JS for that?
> What would be a point of having AutoPostBack enabled for that button
> if I cannot use server side to open a new form anyway.
> How do I attach a JS to the button's click?
> How do I attach a JS to the toolbar button's click?
>
> Thanks
>
>



Nov 18 '05 #8

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

2
3630
by: Patrick Lim | last post by:
Here is the problem: I have written a non-modal frame class in Java for displaying help text when a user is using an application. It works as desired in that if the user selects "help" again, the same frame is used -- this is done using a singleton. The user can do other stuff in the main window while the help window is up. However, when I have a modal dialog pop-up to get information from the user, it blocks events to the help...
2
12251
by: martin de vroom | last post by:
Hi, I have a web page that opens a modal dialog (client side) in the following manner onclick="window.showModalDialog('/dialog.asp',null,'dialogHeight: 200px; dialogWidth: 400px; dialogTop: 300px; dialogLeft: 150px; edge: Sunken; center: Yes; help: No; resizable: No; status: No;');"> and the page loads in the modal dialog no problem.
5
3874
by: MrNobody | last post by:
I am using the no-arg ShowDialog() method hoping that the window would not be modal to any other window like the other ShowDialog(IWin32Window) method does, but when this opens it somehow becomes modal to my main window- even though I don't see how it could even be getting a reference to my main window. What I need is to open a new window but still have my main window available for interaction- the way it opens now it forces focus on this...
2
2563
by: cassidyc | last post by:
Hi, I was wondering if anyone has come accross this issue? And if they have any solutions I have that can create new copies of itself Form1 as = new form1(); af.show(); This form can also bring up a modal dialog (MessageBox)
3
2891
by: Earl Teigrob | last post by:
Can a Modal Dialog Box do forms ASP.NET forms validation from within the Modal Box? I want to pop up a dialog box to the user and have it do its own post backs with validation checking and then save the data and close the dialog when the page is valid. I have read a little about using Iframes to post back to, but was wondering if this would work for what I am trying to do? Also, does anyone have a code sample of this (postback from modal...
10
2758
by: Guadala Harry | last post by:
I have a modal dialog that currently does all of the following except item 4. 1. lets users select a graphic from a list of thumbnails (and when selected, displays the full-size image in a preview DIV) 2. when users close the dialog, the application receives the URL to the selected graphic. 3. the modal dialog lets the users upload a new graphic if the dialog does not present them with one they are already happy with. 4. upon uploading...
2
3690
by: sthrudel | last post by:
Hi! I'm working on a web application in Asp.net and what I would like to have is a cross borwser modal dialog which accepts user's input. I would like to catch what the user clicked on the dialog. To be more specific I want to have a confirmation dialog that is shown when a user clicks on a Delete button (which deletes some values from database). If Yes is pressed the delete action is processed otherwise modal dialog is closed.
4
2920
by: rdemyan | last post by:
I'm using code from the following web page to open the API Browse Folder dialog http://www.mvps.org/access/api/api0002.htm It all works fine. But if the dialog box is open and the user closes Access, the system just hangs and Access apparantly cannot close. I have to open the Windows Task Manager and force the closing (and even that takes quite awhile).
11
2386
by: VK | last post by:
In the continuation of the discussion at "Making Site Opaque -- This Strategy Feasible?" and my comment at http://groups.google.com/group/comp.lang.javascript/msg/b515a4408680e8e2 I have realized that despite suggestions to use DHTML-based modal dialogs are very common? there is not a single fully functional reliable copyright-free cross-browser alternative to say MsgBox (VBScript) or showModalDialog (IE). This way such suggestions up to...
0
9734
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
10656
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
1
10413
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
10138
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
9214
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
1
7674
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
6897
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
5700
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
2
3879
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.