Showing posts with label link. Show all posts
Showing posts with label link. Show all posts

Wednesday, March 28, 2012

modal popup and login

i have a login link, upon clicking it, the modalpopup extender will appear, the problem is the validation of the data...when i click on the login buton, nothing is happening..im very new in using asp.net ajax and not that familiar with javscript. should i create a javascript to pass the validation?or is there any other easy way to do this?

thank you.Smile

Hi,

According to my test, the validation in the login control works when it's placed in a modal popup panel.

Here is my code:

<%@. Page Language="C#" %><!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"><script runat="server"> protected void Button3_Click(object sender, EventArgs e) { TextBox tb = new TextBox(); Panel1.Controls.Add(tb); ModalPopupExtender1.Show(); } protected void Page_Load(object sender, EventArgs e) { } protected void Button6_Click(object sender, EventArgs e) { ModalPopupExtender1.Hide(); }</script><html xmlns="http://www.w3.org/1999/xhtml" ><head runat="server"> <title>Untitled Page</title> <script type="text/javascript"> function changeID(newOkControlID) { var ext = $find("ModalPopupExtender1"); if (ext._OkControlID) { $removeHandler($get(ext._OkControlID), 'click', ext._okHandler); ext._okHandler = Function.createDelegate(ext, ext._onOk); ext._OkControlID = newOkControlID; $addHandler($get(ext._OkControlID), 'click', ext._okHandler); } } </script></head><body> <form id="form1" runat="server"> <div> <asp:ScriptManager ID="ScriptManager1" runat="server"> </asp:ScriptManager> </div> <asp:Button ID="Button1" runat="server" Text="Popup via client" /> <asp:Button ID="Button3" runat="server" OnClick="Button3_Click" Text="Popup via Server" />  <input id="Button5" type="button" value="Change OK Button ID" onclick="changeID('button4');" /> <asp:Panel ID="Panel1" runat="server" Height="50px" Width="125px"> <asp:Panel ID="Panel2" runat="server" Style="cursor: move;background-color:#DDDDDD;border:solid 1px Gray;color:Black"> <div> <p>Choose the paragraph style you would like:</p> </div> </asp:Panel> This is popup control<asp:Login ID="Login1" runat="server"> </asp:Login> <br /> <input id="Button2" type="button" value="button" /> <input id="Button4" type="button" value="button" /> <asp:Button ID="Button6" runat="server" OnClick="Button6_Click" Text="Hide via Server" /></asp:Panel>     <ajaxToolkit:ModalPopupExtender ID="ModalPopupExtender1" OkControlID="Button2" PopupDragHandleControlID="Panel2" PopupControlID="Panel1" runat="server" TargetControlID="Button1"> </ajaxToolkit:ModalPopupExtender> <script type="text/javascript"> Sys.Application.add_load(modalSetup); function SetFocusOnControl() { $get("Login1_UserName").focus(); } function modalSetup() { var modalPopup = $find('ModalPopupExtender1'); modalPopup.add_shown(SetFocusOnControl); // modalPopup.show(); }</script> </form></body></html>

modal popup and update panel

hi there, i have a login button that when it is clicked, the modal popup will trigger and was able to logon to the system. the page has two link buttons, when i click on the 2nd link, the update panel will display the items assiciated with that link, and when i click on the 1st link, the update panel will display the items associated to the 1st link, its lakie i have a tabs..the problem is, when i added the modal popup on that page, and clicked on the 2nd link, it will not display the items of that link, i mean, it will not trigger any event at all...but when i remove the modal popup extender on that link, it will toggle..what am i missing here??please help.

thank you .Smile

Can you show me some code so that I can reproduce it?

Monday, March 26, 2012

Modal popup in gridview

Hi,In a gridview,I want to have a column with a link control,clicking itshould display modal pup control,which will have some options withok/cancel button.How can I do it?

I believe others have had success sticking the ModalPopupExtender inside the item template.

Modal Popup In A Repeater

Hi,

Is there a way to use the ModalPopupExtender from inside a repeater -- each item would have a "delete" link button, and on clicking this, the Panel should be shown? Ive tried everything I can think of, but am not getting anywhere.

Thanks

Joe

Hmmm, I have seen modalpopupextender in the repeater before and it worked fine. Do you get any javascript errors, run-time errors about the extender setup, and how are you wiring the extender to the actual button that will cause the pop up to appear?


The ToolkitTests\Manual\DataboundDynamicPopulate.aspx file that comes with the Toolkit includes a ModalPopup in a repeater (DataList).


Thanks for the heads up. Between this and another article I found (sorry, cant find it right now to give credit), I came up with the solution I was looking for.

My solution is here (for my future reference): http://blog.joelowrance.com/archive/2007/07/10/ajax-modalpopupextender-in-a-repeater.aspx


Modal popup is not modal

Hi!

My modal popup doesnt seem to be modal: see the code below. Everything works fine, but when popup appears link behind still can be clicked... What's missing?

<%@dotnet.itags.org. Page Language="C#" AutoEventWireup="true" CodeFile="Default.aspx.cs" Inherits="_Default" %><%@dotnet.itags.org. Register Assembly="AjaxControlToolkit" Namespace="AjaxControlToolkit" TagPrefix="AjaxToolkit" %><!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN" "http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd"><html xmlns="http://www.w3.org/1999/xhtml"><head runat="server"> <title>Untitled Page</title></head><body> <form id="form1" runat="server"> <asp:ScriptManager ID="ScriptManager1" runat="server" /> <div> <asp:Button ID="btnShowPopup" Text="ShowPopup" runat="server" /> <a href="http://www.google.com">Some link</a> <br /> <div id="divPopup" runat="server" style="background-color:Silver; width:500px; height:300px;"> <div id="divHeader" runat="server" style="background-color:Lime"> Header </div> <br /> Some popup content <br /> <asp:Button runat="server" ID="btnOK" Text="OK" /> </div> </div> <AjaxToolkit:ModalPopupExtender runat="server" ID="extPopup" TargetControlID="btnShowPopup" PopupControlID="divPopup" OkControlID="btnOK" PopupDragHandleControlID="divHeader" /> </form></body></html>

PawelRoman:

My modal popup doesnt seem to be modal: see the code below. Everything works fine, but when popup appears link behind still can be clicked... What's missing?

So your issue isn't with anything pertaining to the ModalPopupExtender, but rather with your CSS. Basically, you don't have any CSS. You need to set theBackgroundCssClass attribute on the ModalPopupExtender. Then, you'll need to add that CssClass using inline CSS or using a stylesheet. The CssClass must contain a background definition (background-color or background-image).

Saturday, March 24, 2012

Modal Popup using ModalBox

I have been trying to use the ModalBox ( found at this link --http://wildbit.com/demos/modalbox/).. in my Web Application.but I am having an issue with it .. I am successful at showing the ModalBox except that it is not able to shield the original contents.. the way its supposed to … It comes up along side the current page content … I am wondering what could be possible cause of it .. When I use "position absolute " for the original contents it comes up behind the page content … Here's my scenario: I have a ASP.NET Wizard Control and I have an UpdatePanel around the Wizard Control to make it AJAX-enabled.The aspx containing the Wizard Control has a Master Page. When I go from one step to the next in the Wizard, I am trying to have an intermediate pop-up screen showing currently loading status .. That's where I am using the ModalBox … using which I hope to disable the current contents behind the ModalBox and simultaneously display the "Loading Status" I invoke the "Modal.show()" on a button click event .. The same event also initiates an AJAX request to the server ..I invoke the "Modal.hide()" when the AJAX request returns … in the pageLoading event handler Will greatly appreciate any input ...

Thanks.

Tushar

Hi,

I'm using the modalPopup of AJAXTollKit, and haven't this strange problem, please try it.

Can you show me some of related code if you have more question?

Modal Popup Window is being closed with every button click

Hello,

I have a weird problem withModalPopupExtender. Every time a press any server sidebutton or link on my modal window themodal window is being closed. Is it normal behavior or I do something wrong ?


I need to implement the following scenario

1. Modal window withuser data is shown on the modal window. There are multiple buttons on the window something like assign location to a user etc….All of them require server side functionality.

Thank you,

Tory

Thank you,

Tory

Hi Tory,

This is expected. ModalPopup closes itself on a full postback - and regular button clicks will cause full postbacks. The solution is to wrap the contents of your ModalPopup inside an UpdatPanel so those other button clicks are just treated as partial postbacks.

Thanks,
Ted

Wednesday, March 21, 2012

ModalPanel - How can I us AJAX instead of postback to update database ?

I'm new to AJAX and this suite of tools. I have a page that when a user clicks a link button my ModalPanel with various input fields appears. When the user clicks the okay button I want to make an async call instead of having the page post back. I need to be able to call one of my business objects defined in C# so what is the best way to do this?

If you can provide details or even a small example I would appreciate it.

My code behind method looks like this:

void OnClick(...)

{

Broker b = new Broker();

b.name = NameTextBox.Text;

b.account = AccountTextBox.Text;

b.Save();


}

Why not just wrap the modalpopup in an updatepanel and let the page postback? It is easier then to have access to the server controls from the form and have full interaction with the other page elements during the postback in case you want to update other stuff on the page.

What benefits are you looking for by not posting back?

Jason

ModalPop-Up

Hello,

On my web form I have a repeater control which has a link button as the ItemTemplate.

<asp:RepeaterID="rptMyFavoriteReports"runat="server"OnItemCommand="rptMyFavoriteReports_ItemCommand">

<ItemTemplate>

<asp:ImageID="Image1"runat="server"<b><%#DataBinder.Eval(Container.DataItem,"ReportName") %></b> (<ahref="#"class="anchor">More Information</a>)

<asp:Linkbuttonid="lnkBtn"runat="server"CssClass="anchor">Remove</asp:Linkbutton><br/>

</ItemTemplate>

</asp:repeater>

When the user clicks on this link button the Modal Pop-up should show up. When i set the the modal pop-up extender properties as TargetControlsID="linkbutton:

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

<atlasTools:ModalPopupProperties

TargetControlID="lnkBtn"

PopupControlID="Panel1"

OkControlID="OkButton"

CancelControlID="CancelButton"

OnOkScript="OnOK()"/>

</atlasTools:ModalPopupExtender>

i get the following error.

Object reference not set to an instance of an object.

NullReferenceException: Object reference not set to an instance of an object.]
Microsoft.AtlasControlExtender.ExtenderControlBase`2.ConnectDataBindingHandlers() +276
Microsoft.AtlasControlExtender.ExtenderControlBase`2.OnInit(EventArgs e) +45
System.Web.UI.Control.InitRecursive(Control namingContainer) +459
System.Web.UI.Control.InitRecursive(Control namingContainer) +271
System.Web.UI.Control.InitRecursive(Control namingContainer) +271
System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint) +1739

Any sugesstion how to over come this.

Thanks!!

Hi Radhikap,

Try putting the whole extender inside the repeater's ItemTemplate.

Thanks,
Ted

Hello Ted,

It worked like a charm Thank you

Radhika


Another Problem

my modal pop-up has yes or no options.When the user clicks on yes i have the onOkScript to a javascript function.

my Qs is how do i get the javascript to raise the event repeater_ItemCommand event of the repeater control.

Thanks!!

Radhika


Can you have the onOkScript code end by "clicking" (via .onclick()) a suitable element in the repeater control? I think people have had some success with this approach in the past.