How to make the content appear as pop-up? [Resolved]

Posted by Vijetha under C# on 3/13/2012 | Points: 10 | Views : 1812 | Status : [Member] | Replies : 10
Hi,
i do have 2 div tags(div1,div2) in my page.On click of the button of my first div1 tag, the div2 shd appear as pop-up.
How do i do it???




Responses

Posted by: Sksamantaray on: 3/19/2012 [Member] Silver | Points: 50

Up
0
Down

Resolved
Hi Vijeta,
Attached is a non-ajax pop up.Check it
 Download source file

Thanks,
Sanjay

Vijetha, if this helps please login to Mark As Answer. | Alert Moderator

Posted by: Sksamantaray on: 3/18/2012 [Member] Silver | Points: 25

Up
0
Down

1.Create 2 panels instead of div.If you want div use runat=server.
2.Use ModalPopupExtender of Ajax
3.Then on click Event of Button of Panel-1 call show method of 2nd Panel


Thanks,
Sanjay

Vijetha, if this helps please login to Mark As Answer. | Alert Moderator

Posted by: Patel28rajendra on: 3/18/2012 [Member] Starter | Points: 25

Up
0
Down
Hi

you can use Ajax Modal Popup Extender and use panel to show your content.

see below link

http://www.asp.net/ajaxLibrary/AjaxControlToolkitSampleSite/ModalPopup/ModalPopup.aspx[/LINK

Thanks

R D Patel

Vijetha, if this helps please login to Mark As Answer. | Alert Moderator

Posted by: Vijetha on: 3/19/2012 [Member] Starter | Points: 25

Up
0
Down
Hi sanjay,
can u give me sample code??

Vijetha, if this helps please login to Mark As Answer. | Alert Moderator

Posted by: Sksamantaray on: 3/19/2012 [Member] Silver | Points: 25

Up
0
Down
ok
give me sometime, will give you sample

Thanks,
Sanjay

Vijetha, if this helps please login to Mark As Answer. | Alert Moderator

Posted by: Sksamantaray on: 3/19/2012 [Member] Silver | Points: 25

Up
0
Down
Hi Vijeta,
Try this.

1.

<form id="form1" runat="server">
<asp:ScriptManager ID="ScriptManager1" runat="server">
</asp:ScriptManager>
<div>
<asp:Panel ID="Panel1" runat="server">
<asp:Button ID="Button1" runat="server" Text="Button" onclick="Button1_Click" />
</asp:Panel>


<asp:Panel ID="Panel2" runat="server" BackColor="Wheat" ForeColor="Black" GroupingText="hello">
<br />
<br />
Disign this as per your wish
<asp:Button ID="btnCancel" runat="server" Text="Cancel" />
</asp:Panel>

<ajaxToolkit:ModalPopupExtender ID="Panel2_ModalPopupExtender" runat="server" CancelControlID="btnCancel"
BackgroundCssClass="modalBackground" Drag="True" DropShadow="True"
DynamicServicePath="" Enabled="True" PopupControlID="Panel2"
TargetControlID="Button1">
</ajaxToolkit:ModalPopupExtender>

</div>
</form>


2.
protected void Button1_Click(object sender, EventArgs e)
{
Panel2_ModalPopupExtender.Show();
}


3.
In Web.Config Register the AjaxControlToolkit

<pages validateRequest="false">
<controls>

<add namespace="AjaxControlToolkit" assembly="AjaxControlToolkit" tagPrefix="ajaxToolkit" />

</controls>


Thanks,
Sanjay

Vijetha, if this helps please login to Mark As Answer. | Alert Moderator

Posted by: Vijetha on: 3/19/2012 [Member] Starter | Points: 25

Up
0
Down
Hi Sanjay,
I tried this ,its working fine.But the client says he needs in css manipulation not using ajax.
So can u suggest me other way to achieve it.

Regards,
Vijetha.M.M

Vijetha, if this helps please login to Mark As Answer. | Alert Moderator

Posted by: Patel28rajendra on: 3/19/2012 [Member] Starter | Points: 25

Up
0
Down
Hi

you should use jquery for that

see this links
http://yensdesign.com/2008/09/how-to-create-a-stunning-and-smooth-popup-using-jquery/

http://jqueryfordesigners.com/coda-popup-bubbles/

Thanks

R D Patel

Vijetha, if this helps please login to Mark As Answer. | Alert Moderator

Posted by: Patel28rajendra on: 3/19/2012 [Member] Starter | Points: 25

Up
0
Down
Hi

if you want window as popup then see this link

http://www.quirksmode.org/js/popup.html

R D Patel

Vijetha, if this helps please login to Mark As Answer. | Alert Moderator

Posted by: Sksamantaray on: 3/19/2012 [Member] Silver | Points: 25

Up
0
Down
Hi Vijeta,
I will send you another Program without Ajax

Thanks,
Sanjay

Vijetha, if this helps please login to Mark As Answer. | Alert Moderator

Login to post response