Showing posts with label showing. Show all posts
Showing posts with label showing. Show all posts

Wednesday, March 28, 2012

Modal Popup awith datagrid

I m using Button click to show Datagrid.

When Button is clicked Modal popup appears showing updating as status for 4 secs..and side by side in server side Datagrid is filled.

Now the issue is that Modal up Appears for 4 sec but Datagrid is not displayed.

Query for Fetching the data from Database is running Fine and do bind the data to Data grid but grid is not displayed.

I have update Panel where i put Button (To be clicked),Update Progress and Modal Popup

I have not put Datagrid in Update Panel.

Can this be problem??

Yes you might be right. Try by putting the DataGrid inside the UpdatePanel. And for more details can you post your code, so that it will be easy to diagnolise the problem.


Hi Varun,

In your situation, when click on the Button which is inside the UpdatePanel , it will post all the elements back to the server and returns all to the client but only refresh the content which is inside the UpdatePanel. So you should put the DataGrid inside the UpdatePanel. My suggestion is when updating shows UpdateProgress and when it finished ,we force the ModalPopupExtender to be shown.The DataGrid is moved into the Panel which is associated with ModalPopupExtender.

For example:

Sys.WebForms.PageRequestManager.getInstance().add_endRequest(EndRequestHandler);

function EndRequestHandler(sender, args){
$find("ModalPopupExtender's BehaviorID").show();

}

Best regards,

Jonathan

Monday, March 26, 2012

Modal Popup Hide Not showing Drop Downs again

HI

I am calling .Hide on my modal popup which does hide the modal popup but the drop downs dont appear again.
This is of course only an IE6 issue but there are a fair few people out there with that!

I have tried chaning the visibility style attribute of the drop downs on the server but no joy.

Any ideas?

Steve

My IE 6.0.2900.2180 service pack 2 is running fine... below is my test code.

<%@.Page

Language="C#"%>

<%@.Register

Assembly="AtlasControlToolkit"

Namespace="AtlasControlToolkit"

TagPrefix="atlasToolkit"%>

<!DOCTYPEhtmlPUBLIC"-//W3C//DTD XHTML 1.0 Transitional//EN""http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

<scriptrunat="server">

protectedvoid Page_Load(objectsender,EventArgs e)

{

}

protectedvoid Okay_Validate(objectsender,EventArgs e)

{

if(DummyBox.Text =="")

{

ErrorMessage.Visible =true;

ErrorMessage.Text ="DummyBox is required";

ModalPopupProperties1.Show();

}

else

{

//do yourstuffs.

}

}

protectedvoid HideViaServer_Click(objectsender,EventArgs e)

{

ModalPopupProperties1.Hide();

}

</script>

<htmlxmlns="http://www.w3.org/1999/xhtml">

<headrunat="server">

<title>UntitledPage</title>

<styletype="text/css">

.modalBackground

{

background-color:Gray;

filter:alpha(opacity=70);

opacity:0.7;

}

.modalPopup

{

background-color:#ffffdd;

border-width:3px;

border-style:solid;

border-color:Gray;

padding:3px;

width:250px;

}

</style>

</head>

<body>

<formid="form1"runat="server">

<atlas:ScriptManagerID="ScriptManager"runat="server"EnablePartialRendering="true"/>

<div>

<atlas:UpdatePanelID="Update"runat="server"Mode="Always">

<ContentTemplate>

<asp:ButtonID="Button1"runat="server"Text="Popup"/>

<br/>

<asp:PanelID="Panel1"runat="server"CssClass="modalPopup">

<asp:LabelID="ErrorMessage"runat="server" Visible="false"/>

<asp:DropDownListID="testdropdown"runat="Server">

<asp:ListItem>test1</asp:ListItem>

<asp:ListItem>test2</asp:ListItem>

</asp:DropDownList>

Dummy Box :<asp:TextBoxID="DummyBox"runat="server"/>

<br/>

<asp:ButtonID="FakeOk"style="display:none" runat="server"Text="OK"/>

<asp:ButtonID="FakeCancel"style="display:none" runat="server"Text="Cancel"/>

<br/>

<asp:ButtonID="TheRealDeal_Ok"runat="server"Text="OK Validate"OnClick="Okay_Validate"/>

<asp:ButtonID="TheRealDeal_Cancel"runat="server"Text="Hide"OnClick="HideViaServer_Click"/>

</asp:Panel>

<atlasToolkit:ModalPopupExtenderID="ModalPopupExtender1"runat="server">

<atlasToolkit:ModalPopupProperties

TargetControlID="Button1"

PopupControlID="Panel1"

BackgroundCssClass="modalBackground"

OkControlID="FakeOk"

CancelControlID="FakeCancel"

ID="ModalPopupProperties1"

/>

</atlasToolkit:ModalPopupExtender>

</ContentTemplate>

</atlas:UpdatePanel>

</div>

</form>

</body>

</html>


I have exactly the same problem and my IE6 build is the same as the poster above.

I noticed from his code however that he has put his dropdownlist in an updatepanel, mine was in a table for easy positioning.

surrounded the table in an updatepanel and the problem went away, the dropdownlist still hides when you show the modal poup, but it reappears again when the modalpopup is hidden.

hopefully there will be a fix for this nasty bug soon.

Si

Saturday, March 24, 2012

Modal Popup: Will not access event handler in code behind prior to showing modal popup.

I have an AJAX modal popup that is tied to a 'Continue' button on a ASP.NET page. The issue is that I have required field validators with messages next to controls that need to be displayed if information is missing. Right now, the AJAX modal shows upon pressing 'Continue' regardless of if infomration is missing on the page. I put a break point in the event handler for the 'Continue' button and it never even gets hit.

How can I intervene and NOT show the modal popup untilall required field validators are satisfied?

if (Page.IsValid)
modalDialogExtender.Show()
else
//do nuthin


Yes and No. When pressing the button that is the TargetControlID of the modal box, the button event handler of that TargetID is is never reached prior to the modal being displayed. That is the No. However, I added a second hidden control as the TargetControlD that can not be accessed from the page to satisfy the modal's proerties. Then when my 'Continue' button is pressed, Yes, the code you provided works and is hit and the modal is shown programatically (assuming PageIsValid = True).

Thank you for the response.