IT Community - Software Programming, Web Development and Technical Support

Ajax Popup

This is a discussion on Ajax Popup within the C# Programming forums, part of the Software Development category; Can anyone tell me how to show a popup on clicking a link (anchor tag), the popup could allow me ...


Go Back   IT Community - Software Programming, Web Development and Technical Support > Software Development > C# Programming

Register FAQ Members List Calendar Mark Forums Read
  #1 (permalink)  
Old 08-20-2007, 09:22 AM
SaravananJ SaravananJ is offline
D-Web Programmer
 
Join Date: Aug 2007
Posts: 79
SaravananJ is on a distinguished road
Question Ajax Popup

Can anyone tell me how to show a popup on clicking a link (anchor tag), the popup could allow me to fill the datas from db and also i need anchor element there to redirect to some other page?
Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
Sponsored Links
  #2 (permalink)  
Old 08-21-2007, 05:23 AM
rrrajesh84in rrrajesh84in is offline
D-Web Master
 
Join Date: Mar 2007
Posts: 399
rrrajesh84in is on a distinguished road
Default Re: Ajax Popup

hi

u can do this using a an ajax control "ajaxToolkit:ModalPopupExtender"
__________________
.....................................
''''''
Rajesh''''''
Ants. . . . . . Like me
Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #3 (permalink)  
Old 08-21-2007, 05:34 AM
SaravananJ SaravananJ is offline
D-Web Programmer
 
Join Date: Aug 2007
Posts: 79
SaravananJ is on a distinguished road
Default Re: Ajax Popup

Quote:
Originally Posted by rrrajesh84in View Post
hi

u can do this using a an ajax control "ajaxToolkit:ModalPopupExtender"
Mr Rajesh, i have tried to insert the ajax ToolKit control in my page, but its not working, can you tell me what i have to do?
Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #4 (permalink)  
Old 08-22-2007, 05:54 AM
rrrajesh84in rrrajesh84in is offline
D-Web Master
 
Join Date: Mar 2007
Posts: 399
rrrajesh84in is on a distinguished road
Default Re: Ajax Popup

Quote:
Originally Posted by SaravananJ View Post
Mr Rajesh, i have tried to insert the ajax ToolKit control in my page, but its not working, can you tell me what i have to do?
hi
Sarav..

just check whether u have installed the ajax setup...
__________________
.....................................
''''''
Rajesh''''''
Ants. . . . . . Like me
Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #5 (permalink)  
Old 08-22-2007, 08:58 AM
SaravananJ SaravananJ is offline
D-Web Programmer
 
Join Date: Aug 2007
Posts: 79
SaravananJ is on a distinguished road
Default Re: Ajax Popup

Quote:
Originally Posted by rrrajesh84in View Post
hi
Sarav..

just check whether u have installed the ajax setup...
Hi Rajesh, i have installed Ajax setup, can you send me a code example for this?
__________________
J.Saravanan
Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #6 (permalink)  
Old 08-23-2007, 12:34 AM
rrrajesh84in rrrajesh84in is offline
D-Web Master
 
Join Date: Mar 2007
Posts: 399
rrrajesh84in is on a distinguished road
Default Re: Ajax Popup

Quote:
Originally Posted by SaravananJ View Post
Hi Rajesh, i have installed Ajax setup, can you send me a code example for this?
yes sure. Mr.Saravanan

<asp:ScriptManager ID="ScriptManager1" AsyncPostBackTimeout="36000" runat="server">

<asp:UpdatePanel ID="searchGalleryUpdatePanel" runat="server">
<ContentTemplate>
<div id="searchGalleryDiv" style="visibility: hidden; position: absolute; top: 0px;
width: 150px;" runat="server">
<table width="100%" border="0" cellspacing="0" cellpadding="0">
<tr>
<td align="left" valign="top">
<div style="cursorointer;" onmousedown="initializedrag(event)" onmouseup="stopdrag()">
<table width="100%" border="0" cellspacing="0" cellpadding="0">
<tr>
<td width="1%" align="left" valign="top">
<img src="http://www.discussweb.com/images/img_leftbulletin_header.gif" /></td>
<td align="left" valign="middle" background="http://www.discussweb.com/images/bg_header.gif" class="heading1">
Search
</td>
<td width="1%" align="left" valign="top">
<img src="http://www.discussweb.com/images/img_rightbulletin_header.gif" /></td>
<td width="30%" align="center" valign="middle" background="http://www.discussweb.com/images/bg_panel_header.gif">
<a class="txttoplink" name="bannedReasonClose" id="A1" onmouseover=" window.status='close'; return true"
href="" onclick="javascript:HideSearchGallery(); return false">close </a>
</td>
<td width="1%" align="left" valign="top">
<img src="http://www.discussweb.com/images/img_right_header.gif" /></td>
</tr>
</table>
</div>
</td>
</tr>
<tr>
<td align="left" valign="top" class="panelbor">
<table width="100%" border="0" cellspacing="0" cellpadding="0">
<tr>
<td align="left" valign="middle" bgcolor="#eff0eb">
<asp:Panel runat="server" DefaultButton="topSearchImageButton" ID="searchPanel">
<table width="100%" border="0" cellspacing="8" cellpadding="0">
<tr>
<td align="left" valign="top">
<aspropDownList ID="searchUploadTypeDropDownList" CssClass="formTextBox" runat="server"
DataValueField="Id" DataTextField="Name" AppendDataBoundItems="true">
</aspropDownList>
</td>
</tr>
<tr>
<td align="left" valign="top">
<asp:TextBox ID="topSearchTextBox" CssClass="formTextBox" MaxLength="20" runat="server"></asp:TextBox>
</td>
</tr>
<tr>
<td align="left" valign="top">
<asp:ImageButton ID="topSearchImageButton" ImageUrl="http://www.discussweb.com/images/btn_h_search.gif" runat="server"
OnClick="topSearchImageButton_Click" />
</td>
</tr>
</table>
</asp:Panel>
</td>
</tr>
</table>
</td>
</tr>
</table>
</div>
</ContentTemplate>
</asp:UpdatePanel>

</asp:ScriptManager>
<a id="searchGalleryA" class="txttoplink" name="searchGalleryA" href="#" onclick="javascript:ShowSearchGallery('searchGalle ryA'); return false">
Search </a>
JS:-

var dragapproved=false
var ie5=document.all&&document.getElementById
var ns6=document.getElementById&&!document.all
function ShowSearchGallery(aname)
{
browsername = navigator.appName;
var c = getAnchorPosition(aname);
//alert ('X: ' + c.x + ' Y:' + c.y);
document.getElementById('ctl00_searchGalleryDiv'). style.visibility = "visible";
if( browsername == "Netscape")
{
left =(c.x-30);
document.getElementById('ctl00_searchGalleryDiv'). style.left = left+"px";
document.getElementById('ctl00_searchGalleryDiv'). style.top = (c.y+15)+"px";
}
else if( browsername == "Microsoft Internet Explorer")
{
document.getElementById('ctl00_searchGalleryDiv'). style.left = c.x-30;
document.getElementById('ctl00_searchGalleryDiv'). style.top = c.y+15;
}
}

function HideSearchGallery()
{
document.getElementById('ctl00_searchGalleryDiv'). style.visibility = "hidden";
}

function drag_drop(e)
{
if (ie5&&dragapproved&&event.button==1){
document.getElementById('ctl00_searchGalleryDiv'). style.left=tempx+event.clientX-offsetx+"px";
document.getElementById('ctl00_searchGalleryDiv'). style.top=tempy+event.clientY-offsety+"px";
}
else if (ns6&&dragapproved){
document.getElementById('ctl00_searchGalleryDiv'). style.left=tempx+e.clientX-offsetx+"px";
document.getElementById('ctl00_searchGalleryDiv'). style.top=tempy+e.clientY-offsety+"px";
}
}
function initializedrag(e)
{
offsetx=ie5? event.clientX : e.clientX;
offsety=ie5? event.clientY : e.clientY;

tempx=parseInt(document.getElementById('ctl00_sear chGalleryDiv').style.left);
tempy=parseInt(document.getElementById('ctl00_sear chGalleryDiv').style.top);

dragapproved=true;
document.getElementById('ctl00_searchGalleryDiv'). onmousemove=drag_drop;
document.getElementById('ctl00_searchGalleryDiv'). onmouseout =stopdrag;
}
function stopdrag()
{
dragapproved=false;
document.getElementById('ctl00_searchGalleryDiv'). onmousemove=null;
}




the above sample helps u clearly
__________________
.....................................
''''''
Rajesh''''''
Ants. . . . . . Like me

Last edited by rrrajesh84in : 08-23-2007 at 12:37 AM.
Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #7 (permalink)  
Old 08-23-2007, 12:58 AM
SaravananJ SaravananJ is offline
D-Web Programmer
 
Join Date: Aug 2007
Posts: 79
SaravananJ is on a distinguished road
Thumbs up Re: Ajax Popup

Hey Rajesh,

It looks superb and works fine for me, why cant you give me some more optimized code using pure AJAX.

Thanks in advance
__________________
J.Saravanan
Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #8 (permalink)  
Old 08-24-2007, 07:29 AM
rrrajesh84in rrrajesh84in is offline
D-Web Master
 
Join Date: Mar 2007
Posts: 399
rrrajesh84in is on a distinguished road
Default Re: Ajax Popup

Quote:
Originally Posted by SaravananJ View Post
Hey Rajesh,

It looks superb and works fine for me, why cant you give me some more optimized code using pure AJAX.

Thanks in advance
hi

<ajaxToolkit:ModalPopupExtender ID="MPE" runat="server"
TargetControlID="LinkButton1"
PopupControlID="Panel1"
BackgroundCssClass="modalBackground"
DropShadow="true"
OkControlID="OkButton"
OnOkScript="onOk()"
CancelControlID="CancelButton"
PopupDragHandleControlID="Panel3" />
__________________
.....................................
''''''
Rajesh''''''
Ants. . . . . . Like me
Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #9 (permalink)  
Old 08-24-2007, 07:37 AM
SaravananJ SaravananJ is offline
D-Web Programmer
 
Join Date: Aug 2007
Posts: 79
SaravananJ is on a distinguished road
Default Re: Ajax Popup

Quote:
Originally Posted by rrrajesh84in View Post
hi

<ajaxToolkit:ModalPopupExtender ID="MPE" runat="server"
TargetControlID="LinkButton1"
PopupControlID="Panel1"
BackgroundCssClass="modalBackground"
DropShadow="true"
OkControlID="OkButton"
OnOkScript="onOk()"
CancelControlID="CancelButton"
PopupDragHandleControlID="Panel3" />
Hey Rajesh, Can you explain the properties in detail...?
__________________
J.Saravanan
Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #10 (permalink)  
Old 08-24-2007, 08:33 AM
rrrajesh84in rrrajesh84in is offline
D-Web Master
 
Join Date: Mar 2007
Posts: 399
rrrajesh84in is on a distinguished road
Default Re: Ajax Popup

Quote:
Originally Posted by SaravananJ View Post
Hey Rajesh, Can you explain the properties in detail...?
hi

* TargetControlID - The ID of the element that activates the modal popup

* PopupControlID - The ID of the element to display as a modal popup

* BackgroundCssClass - The CSS class to apply to the background when the modal popup is displayed

* DropShadow - True to automatically add a drop-shadow to the modal popup

* OkControlID - The ID of the element that dismisses the modal popup

* OnOkScript - Script to run when the modal popup is dismissed with the OkControlID

* OkCancelID - The ID of the element that cancels the modal popup

* OkCancelScript - Script to run when the modal popup is dismissed with the CancelControlID

* PopupDragHandleControlID - The ID of the embedded element that contains the popup header/title which will be used as a drag handle

* X - The X coordinate of the top/left corner of the modal popup (the popup will be centered horizontally if not specified)

* Y - The Y coordinate of the top/left corner of the modal popup (the popup will be centered vertically if not specified)
__________________
.....................................
''''''
Rajesh''''''
Ants. . . . . . Like me
Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #11 (permalink)  
Old 08-28-2007, 12:41 AM
SaravananJ SaravananJ is offline
D-Web Programmer
 
Join Date: Aug 2007
Posts: 79
SaravananJ is on a distinguished road
Default Re: Ajax Popup

Hi Rajesh,

Thanks for your help, will try in my environment and let you know if i need
your help....
__________________
J.Saravanan
Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
Reply


Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
how to use ajax in asp.net and how to install ajax in my system vel.m8 ASP and ASP.NET Programming 5 04-08-2008 08:55 PM
Remove popup blocker in IE` shaalini HTML, CSS and Javascript Coding Techniques 2 03-31-2008 01:13 AM
How to move a PopUp div to be opened at desired location? poornima ASP and ASP.NET Programming 2 03-17-2008 08:50 PM
How to pass session values in popup window Mramesh HTML, CSS and Javascript Coding Techniques 3 03-13-2008 09:01 PM
How to make a popup for a particular region on the page? Archer ASP and ASP.NET Programming 1 07-24-2007 12:31 AM


All times are GMT -7. The time now is 10:44 PM.


Copyright ©2004 - 2007, DiscussWeb. All Rights Reserved.

SEO by vBSEO 3.0.0