Open modal dialog

  • Thread starter Thread starter Mark Goldin
  • Start date Start date
M

Mark Goldin

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
 
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.
 
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.
 
Can a new form be pushed from the server?

Paul Glavich said:
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.
 
Here is a code I am using:
this.Toolbar1.Attributes.Add("onclick", "executeClick()");

In HEAD section on my aspx page I have:

<script language="javascript" 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?
 
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 registerstartupscript that will do that for you.
 
I guess you misswritten the js.


Mark Goldin said:
Here is a code I am using:
this.Toolbar1.Attributes.Add("onclick", "executeClick()");

In HEAD section on my aspx page I have:

<script language="javascript" 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?
 
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?
 
Back
Top