Showing posts with label asp. Show all posts
Showing posts with label asp. Show all posts

Wednesday, March 28, 2012

Modal Popup and Listbox control

Is it possible to use modal popup with asp listbox control? I would like to show modal popup once an item in the asp lisbox is double-clicked. Any ideas, tips, help, or anything else on how to achieve this functionality?

Thanks in advance,
Marko Vuksanovic.

Answered here, I think:http://forums.asp.net/thread/1448453.aspx

Modal Popup creation problem

I have a project that has several asp .net AJAX controls including a Tab Panel extender, a couple of updatepanels, and a modalpopup. Everything was doing OK (except for the tab panel that keeps disappering on hover over) until I added the modal popup. The page will load but I noticed that I was getting an "Done, but with errors on page" warning and the calendar that sets everything in motion didn't work.

It appears that the modalpopup isn't being created properly at runtime. I see this error message when I follow the error message in Firefox (Firebug):

this._popupElement has no properties
http://mycomputer/mysite/ScriptResource.axd?d=SpCqOYElt5QoLvf_3bBsv_BcFBS3DknA98So9KH3qtFJpwGddMmhi5Fqd8Ekf5Yggy7J5Sw9EaHCqlfKI150bSF4O1S83qGJROU-7k6SGQc1&t=633121015687656250
Line 66

Which further expands to:

initialize()ScriptResource.ax... (line 66)

Sys$Component$endUpdate()ScriptResource.ax... (line 2702)

Sys$Component$create(function(),Object BackgroundCssClass=modal CancelControlID=btnClose,null,null,input#Trigger)ScriptResource.ax... (line 2856)

(no name)()livereports.aspx (line 217)

_handler(Object _disposableObjects=[4] _components=Object,Object)ScriptResource.ax... (line 2503)

Sys$_Application$_doInitialize()ScriptResource.ax... (line 3792)

(no name)()

Why isn't there a comma between Object BackgroundCssClass=modal & CancelControlID=btnClose? Where are all of the properties that I set? This is how the modalpopupextender is set up in my project:

I am totally lost since I don't see much difference in the source code between mine and the AJAX samples function:

Mine:

Sys.Application.add_init(function() {

217 $create(AjaxControlToolkit.ModalPopupBehavior, {"BackgroundCssClass":"modal","CancelControlID":"btnClose","DropShadow":true,"DynamicServicePath":"/scmghd/livereports.aspx","OkControlID":"btnClose","PopupControlID":"gvResults","PopupDragHandleControlID":"pnl1","id":"ModalPopupExtender2"}, null, null, $get("HiddenModalTrigger"));

218});

AJAX Sample:

Sys.Application.add_init(function() {

314 $create(AjaxControlToolkit.ModalPopupBehavior, {"BackgroundCssClass":"modalBackground","CancelControlID":"ctl00_SampleContent_CancelButton","DropShadow":true,"OkControlID":"ctl00_SampleContent_OkButton","OnOkScript":"onOk()","PopupControlID":"ctl00_SampleContent_Panel1","PopupDragHandleControlID":"ctl00_SampleContent_Panel3","dynamicServicePath":"/AJAX/AjaxControlToolkit/Samples/ModalPopup/ModalPopup.aspx","id":"ctl00_SampleContent_ModalPopupExtender"}, null, null, $get("ctl00_SampleContent_LinkButton1"));

315});

This is the way I have the modalpopup set in Visual Web Dev:

<cc1:ModalPopupExtenderID="ModalPopupExtender2"runat="server"BackgroundCssClass="modal"TargetControlID="Trigger"PopupDragHandleControlID="pnl1"PopupControlID="gvResults"CancelControlID="btnClose"OkControlID="btnClose"DropShadow=true>

</cc1:ModalPopupExtender>

Again any help is appreciated!

I hate to be a bother but this project is very important...any help would greatly be appreciated.

Thanks

Saturday, March 24, 2012

Modal Popup with asp.net controls on a masterpage through code behind

For some reason, if I have a masterpage, which has a modal popup control (or any toolkit item it seems) and if I have asp.net controls inside of that toolkit control like a textbox or something. If I try and access that textbox from code behind file of that masterpage it will not find it.

Anyone else had this issue?

I have commented out all my code and slowly tested my way through adding it back in and nothing works. But if I take that same exact code and put it on a regular (non-masterpage) file, it works like it's supposed to.

So what am I doing wrong on the masterpage to be able to find my controls from codebehind? Is there some sort of "extra" code I need to use to access items inside of a toolkit control for masterpages specifically?

Thanks.

Scratch that, I'm a freaking moron it seems.

I thought I was in the "page_load" sub, but I was not inside of any sub or function.

Apparently been a long day, I'm good now.

Thanks

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.

Modal Popup, DetailsView and UpdatePanel combined.

Hi all, this is my first foray into Atlas (and ASP.net) and I have come stuck with the following problem:

I am developing a simple lookup screen that lists users names along with email addresses in a GridView. There is a DetailsView control that allows insertion of new users as required. The lookup is contained within an updatePanel so only this portion of the page is refreshed when items are added, deleted, or changed. This works fine until:

I put the DetailsView into an atlas ModalPopup and have an 'Add User...' button. At this point the whole page refreshes and I cannot for the life of me get it to work correctly.

I have tried everything I can think of, scoured the web and forums but still no luck. I can get two of the three items (UpdatePanel, DetailsView, ModalPopup) working at once but the addtion of the third causes it all to go horribly wrong.Confused [*-)]

Can anyone out there help me?

Try adding UseSubmitBehavior="false" to the button that's causing the refresh. If that doesn't help, please post a simple sample demonstrating the problem. Thanks!

Modal Popup with Server-Side search

I'm building a data-driven ASP.NET page for processing phone orders. The page starts out with a listing of the items contained in the order, and the user's billing/shipping info.

I'd like to feature a popup that lets the operator search for additional products to add to the order. Sort of like the modal popup control, but with a Textbox for keyword searches, submit button, and a DataGrid for results. The results grid will have linkbuttons by each search result to add it to the order. Clicking the link button will add the item to the order (updated in the order form below the popup), and close the popup.

Is this possible to do with AJAX? I could do this with a regular javascript window.open popup, but I'm hoping for something that acts more like a fat-client application than a web app.

Thanks,

Frank

Yes it is possible. Here's a simplified version of what you want to do.
http://ajax.asp.net/docs/Samples/UpdatePanelApplicationSample1/cs/UpdatePanel4CS.aspx (the focus of this example is animation but it shows the basic idea of what you described)
Clicking the calendar icon unhides an panel where you could select a date. (You could instead have a DataGrid inside the panel.) When finished, the panel can be hidden. This can be done all with server side controls with no page flicker.

This example code is here:
http://ajax.asp.net/docs/ViewSample.aspx?sref=UpdatePanelApplicationSample1 (UpdatePanel4CS.aspx)

These examples are on this doc page:
http://ajax.asp.net/docs/tutorials/usingMsAjaxLibrary/default.aspx


Thanks... this is a good start for me.

Modal popups without using server-side extenders

First, I should say that I really like ASP.NET AJAX. I've been trying it out off or on for the last several months and there is a lot to like. UpdatePanels are a great for quickly adding AJAX to a WebForm and the ability to call a webmethod directly from Javascript is cool. I'm a little less impressed with the Control Toolkit -- mainly because it doesn't really do what I want but I haven't found a better solution. My understanding is that the toolkit provides controls that can be added to a WebForm much like regular controls. But I want to do things more on the client side in javascript and just make AJAX calls to my webmethods when I need to interact with the server. But I also want to take advantage of some of the slick UI features that are associated with AJAX -- mostly ModalPopups. Up to now, I've been using the ModalPopupExtender by creating a panel (using a DIV) and by programmatically instantiating the like this:

function InitializeSavePageModalPopup() { __SavePageModalPopup =new AtlasControlToolkit.ModalPopupBehavior(); __SavePageModalPopup.set_BackgroundCssClass('modalBackground'); __SavePageModalPopup.set_DropShadow(true); __SavePageModalPopup.set_PopupControlID('SavePageModalPopup'); $("button_save").control.get_behaviors().add(__SavePageModalPopup); __SavePageModalPopup.initialize();}

To make this work, I was adding a 'dummy' extender tag so that the appropriate javascript libraries would load:

<cc1:ModalPopupExtender ID="EmptyModalPopupExtender" runat="server" />

Now with the AJAX Beta, I have to add a full ModalPopupExtender, that is, it has to have all it's required properties. Not the end of the world, and I've mostly got it working, but it got me thinking that there must be a better way to do what I want to do. It would be nice if the javascript behavior that is used by the extender was divorced from the server-side extender code. And it got me thinking of how I think it should be. In my ideal world, I would be able to just create a modal like this:

oModalConfirm = new ModalConfirm("Are you sure you want to do that?");

oModalConfrim.show();

In this example, it would be a modal that acts like a confirm modal, with an OK and Cancel button. Clicking on those buttons would fire an event. There could be different classes for different types of Modals (Alert, Confirm, Wait/processing, and even forms).

My questions are: has this sort of thing been done? Is there a better way to use the behaviors embedded with the toolkit extenders? I've looked over some other libraries such as the Yahoo UI toolkit but would rather not have to have a whole new system to learn and include but is there something that does what I want that you would recommend?

-Alex

For what it's worth, you can use the .js behaviors directly, though hooking all the dependencies up correctly may not be trivial. What may be easiest is if you create the page using the extender, then view-source the resulting content and borrow liberally from there.

modal window (asp.net ajax page) not closing

Hello, I'm creating a pop up using 'window.showModalDialog', the page that opens is a asp.net ajax page. I'm displaying a gridview on this. When user selects a row from the gridview, i need to store the selected value to session variable and close the popup window. I'm using the below code on the select image button click. If i manually closes the popup window, it get backs to the parent. The code on click event is

ProtectedSub OnSelect(ByVal senderAsObject,ByVal eAs CommandEventArgs)

Dim strScriptAsString ="<script language='javascript'>window.returnValue='" + retVal +"';window.close();</script>"

If (e.CommandName.Equals("cmdSelTag"))Then

Session(Utility.Constants.SelectedTagDefinitionId) = e.CommandArgument.ToString()

IfNot ClientScript.IsStartupScriptRegistered("clientScript")Then

ClientScript.RegisterStartupScript(GetType(Page),"clientScript", strScript)

EndIf

EndIf

EndSub

Note: If make it asp.net page rather than asp.net ajax page, then this works fine.

Any help is appreciated.

Hi.. i used ScritManager.RegisterStartupScript instead of ClientScript.RegisterStartupScript. Now its working.

ModalPanelExtention missing in Toolbox

Hallo,

I would like to build an applikation with the modalPanalExtention like in the asp.net Tutorial Video.

I installed all the files from ajax.asp.net (rc, controlToolkit) and I added the framework components to my VS2005, but the ModalPanelExtention is still missing.

Can somebody tell me from witch DLL do I have to implement this Extention to my Toolbox an where do I find it?

Regards from Germany (Cologne)

there is only one file you need to apply on your Toolbox which is AjaxControlToolkit.dll

In my article, i also mention how to apply AjaxControlToolkit.dll to Toolbox

http://www.c-sharpcorner.com/UploadFile/MIB426/IntroductionAJAXCollapsiblePanel01032007132314PM/IntroductionAJAXCollapsiblePanel.aspx

Wednesday, March 21, 2012

ModalPopUp

I have have a datalist with a LinkButton on it. I want the LinkButton to be myTargetControlID. I cant remember the asp code to find the control on the datalist. Thanks.did you figure this out?

is it by any chance

yourDataList.FindControl("yourLinkButton") ?

ModalPopup - how to prevent interaction with page?

In the example onhttp://ajax.asp.net/ajaxtoolkit/ModalPopup/ModalPopup.aspx the ModalPopup prevents interaction with the page. If I copy and paste that code, the panel shows but I still can interact with the page, respectively the control elements in the back. What do I need to apply to make this work like in the example? How do I block the interaction (except with the newly opened panel)Any hint highly appreciated.

<asp:ScriptManagerid="ScriptManager1"runat="server"></asp:ScriptManager><asp:UpdatePanelid="UpdatePanel1"runat="server"><contenttemplate>

<

ajaxToolkit:ModalPopupExtenderid="ModalPopupExtender1"runat="server"CancelControlID="ButtonCancel"OnOkScript="onOk()"OkControlID="ButtonOK"DropShadow="true"PopupControlID="PanelRentals"TargetControlID="ButtonGo"BackgroundCssClass="modalBackground"> ></ajaxToolkit:ModalPopupExtender><asp:Panelid="PanelRentals"runat="server"Height="50px"Width="125px"BorderStyle="Solid"><asp:Labelid="Label1"runat="server"Text="Rentals"></asp:Label> <asp:Buttonid="ButtonCancel"runat="server"Text="Cancel"></asp:Button><asp:Buttonid="ButtonOk"runat="server"Text="OK"></asp:Button></asp:Panel><asp:Buttonid="ButtonGo"runat="server"Text="Button"></asp:Button>

</

contenttemplate></asp:UpdatePanel>

You need to define a CSS class for the BackgroundCssClass property (named "modalBackground" in the snippet above). SampleWebSite does this in StyleSheet.css as:

.modalBackground {
background-color:Gray;
filter:alpha(opacity=70);
opacity:0.7;
}