Showing posts with label hii. Show all posts
Showing posts with label hii. Show all posts

Wednesday, March 28, 2012

Modal Popup Extender

hi

i have used ModalPopupExtender on my web page and it is really good but the problem is if i click any button then it close the panel.

is it possible to use some validation control on the panel like i want to insert data into database, also i want to add a close button on the panel, without click close button that panel will be enable on the page.

thanks is advance

You can add a UpdatePanel in your panel, and put your detailviews in this UpdatePanel.

All the behavior you do in the UpdatePanel will not effect other controls that out side of this Panel.

Monday, March 26, 2012

Modal Popup Extender positioning

Hi

I have a div that centralises the webpage in the browser, this is relative and then I have absolute positioning of graphics inside this, etc.

Problem I have is when adding the ModalPopupExtender, it goes pearshaped, the popup is top left and the modal background is underneath the div container, I have positioned the Extender in various places and sometimes its behind other div's etc...

Whatever I do it wont appear on top, any ideas?

Thanks

R

Have you tried setting the z-index of the modal popupextender TargetControlID (Panel)? set the z-index to 1000 and it should show some difference.

Let me know what happens.

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

ModalPopExtender, Javascript & Master page

Hi

I googled about this problem and never found an answer. Everybody is complaining about it but nobody found any solution. I thought I will put the problem in this forum so some AJAX Guru can research and help us.

Here is the problem,

Whenever you use the ModalPopExtender and try to do something during begin of the postback or at the end of post back via javascript. It works fine in the single page. But as soon you add a master page, it doesn't work. It either says "null, null object not found" or object not found.. Whats the problem when its master page

<scripttype="text/javascript">

Sys.WebForms.PageRequestManager.getInstance().add_beginRequest(beginRequest);

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

function beginRequest(sender, args){

// show the popup

alert("here0");

var cmb = $find('mdlPopup');

//alert("here");

//find$('<%= mdlPopup.ClientID %>').show();

//var cmb = document.getElementByName('<%= mdlPopup.ClientID %>');

//var cmb = document.getElementByName(GetClientId("mdlPopup"));

if (cmb !=null) {

cmb.show();

alert("here2");

}

}

function endRequest(sender, args) {

// hide the popup

alert("here3");

$find('mdlPopup').hide();

}

</script>

<asp:UpdatePanelID="updatePanel2"runat="server">

<ContentTemplate>

<table>

<tr>

<td>

Signature:</td>

<td>

<asp:TextBoxID="signatureText"runat="server"/></td>

</tr>

<tr>

<td>

Bio:</td>

<td>

<asp:TextBoxID="bioText"runat="server"/></td>

</tr>

</table>

<asp:ButtonID="Button3"runat="Server"Text="Save"/>

<asp:LinkbuttonID="Button1"runat="Server"Text="Save"/>

<br/><br/>

Hit Save to cause a postback from an update panel inside the tab panel.<br/>

</div>

</ContentTemplate>

</asp:UpdatePanel>

<ajaxToolKit:ModalPopupExtender

ID="mdlPopup"runat="server"TargetControlID="pnlPopup"

PopupControlID="pnlPopup"BackgroundCssClass="modalBackground"/>

<asp:PanelID="pnlPopup"runat="server"CssClass="updateProgress"style="display:none">

<divalign="center"style="margin-top:13px;">

<imgsrc="../Images/simple.gif"/>

<spanclass="updateProgressMessage">Loading ...</span>

</div>

</asp:Panel>

It will really help if somebody finds a solution for it..

VIJAI

Hi,

Thank you for your post!

This works on my machine:

<script type="text/javascript">
Sys.WebForms.PageRequestManager.getInstance().add_beginRequest(beginRequest);
Sys.WebForms.PageRequestManager.getInstance().add_endRequest(endRequest);
function beginRequest(sender, args){
alert("here0");
var cmb = $find('<%=mdlPopup.ClientID %>');
cmb.show();
alert("here2");
}
function endRequest(sender, args) {
alert("here3");
$find('<%=mdlPopup.ClientID %>').hide();
}

</script>

If yo have further questions,let me know!

Best Regards,

Wednesday, March 21, 2012

modalpopup

hii need to use a modalpopup to add an item to my dropdownlist.my dropdownliste extract the itmes from an oracle database.

the client click on a botton to add the new item in the database and i want that the ddl refreshe.

can u help me plez.

1<asp:Panel runat="server" id="pnl_add">2 <asp:TextBox runat="server" id="txt_name" />3 <asp:RequiredFieldValidator runat="server" id="rfv_name"4 ControlToValidate="txt_name"5 ToolTip="Please enter a name"6 ErrorMessage=" *" />7 <asp:Button runat="server" id="btn_ok"8 Text="Ok" />9 <asp:Button runat="server" id="btn_cancel"10 Text="Cancel" />11</asp:Panel>12<ajaxToolkit:ModalPopupExtender runat="server" id="mpe_add"13 TargetControl="btn_add"14 PopupControlID="pnl_add"15 CancelControlID="btn_Cancel" />1617<asp:UpdatePanel runat="server" id="up_items"18 RenderMode="block"19 UpdateMode="conditional">20 <Triggers>21 <asp:AsyncPostBackTrigger22 ControlID="btn_Ok"23 EventName="Click" />24 </Triggers>25 <ContentTemplate>26 <asp:DropDownList runat="server" id="ddl_items" />27 </ContentTemplate>28</asp:UpdatePanel>
1Protected Sub btn_Ok_Click(sender asObject, e as EventArgs) handles btn_Ok.Click2'insert into database34 up_items.Update()5End Sub