dragoon
Posts: 173
|
Posted: 11/10/2010, 1:30 AM |
|
Hi there,
As many reported in .NET forums that the modal is not working or disapearing after a couple of seconds here is a solution.
Consider the following scenario:
- grid / editable grid with a column with link control
- a record form to be shown in modal window (with additional details of the grid row)
Solving the puzzle:
1. put an onclick event in link control:
onclick="ShowModal1_show();return false;"
"return false" prevents the page being refreshed (this is why the modal disapears)
2. the above solution is working as long you don't need to pass a parameter to the record in the modal; in this case you need to let the page to refresh a get the needed parameter from the URL.
To get the modal working put the following script in the onload event of the page
var url = window.location.href;
if (url.indexOf("parameter_id") > 0) {
ShowModal1_show();
}
this part of the code should be the last in the onload event of the page
3. Have a button or a link in the modal window with the following code
onclick="ShowModal1_hide();return false;"
put "return false" only when you don't want the page to refresh.
|