Showing posts with label playing. Show all posts
Showing posts with label playing. Show all posts

Wednesday, March 28, 2012

Dynamic Content into ModalPopup

I've just started playing with the AJAX Toolkit. One thing I am stuck on, ishow to get dynamic content into the controls that are in the modalPopup PopupControlID?

A very simple example:

There is a textbox and a button. When you enter text then click the button, a modal popup appears saying "You entered..." and whatever you typed. Is there a way to do this in the codebehind? It dosen't seem like the button click event is firing since it is the "TargetControlID" of the modalPopup.

Thanks

Have a look at this bloghttp://blogs.msdn.com/delay/archive/2006/09/19/762609.aspx. I did this my self the other day but I did it a slightly different way, when I get back to work I will post the code.


Thank you for the reply. I took a look at the article, and there is some good information there. I actually ended up accomplishing what I need by assigning the "TargetControlID" to a bogus control (using this example, it's a bummer this property cannot be null or empty) and using the ModalPopupExtender1.Show() method. This seems to be doing the trick. This way, I can use any event or condition to pop the ModalPopup, and all of the controls (including the panel i am using as the "PopupControlID". are accessable at design.

So, i have a button, on the click event i create all of the controls i need and add them to the panel, then call ModalPopup1.Show() and there it is.

Now the problem i'm facing is getting values from the ModalPopup back into the main screen. For example, if I have a textbox in the ModalPopup, when the user clicks OK on the modalpopup, how to i get that value? Remember that the TextBox and it's properties were generated at runtime, so after postback, they wont' exist. I guess I could try to use the Request.Form key values?


bortiquai:

I guess I could try to use the Request.Form key values?

This is a option.

Or you can use a HiddenField which will always be on the page to keep this value. The value of HiddenField can be set in onclick client side event handler of ok button.

Monday, March 26, 2012

DropShadowExtender display issue

Im jsut playing about with the drop shadow extender and when i come to use it for the first time i have hit a major snag.

I have bound it to a panel which contains some text, when i run the page, i get the rounded corners of the panel, but the shadow (or I shoud say a black image the same size of the panel) appears about an inch lower down on the screen and not even remotely connected to the panel, let alone behind it to give a shadow effect.

Anyone else run into this?

I am having the same issue. Is there a solution to this?



...Have you tested this in both IE7 and FireFox?

If it displays properly in one but not the other it's probably due to HTML rendering.

You can resolve this behavior by removing HTML tags, especially tags like HTML header tags.
Replace them with ASP.NET CSS, then they should render properly in the toolkit div sections.


Yes, it's hosed the same in Firefox.

Surely someone, somewhere is using this thing somehow got it working outside of the samples.

I've recreated this page four times now and it's still not working correctly.

Wednesday, March 21, 2012

DropDownList Events

Hi There,

I started playing ASP.NET AJAX some months ago as part of a Universiy project. I've recently come back to it and have made most of the changes I think I need to make to use the new ASP.NET AJAX beta (I was previously using the Atlas CTP). However, I have a problem with dwopdownlist event names.

I have a basic application that has a drop down list and a repeater. The dropdownlist is bound to the one side of a DB relationship and the repeater is bound to the many. All works fine in terms of displaying the controls on the page but I can't get the repeater control list to change based on the valyue selected in the dropdown list. The last few lines of code within <asp:updatePanel/> are as follows:

<Triggers>

<asp:AsyncPostBackTriggerControlID="DropDownList1"EventName="OnSelectedIndexChange"/></Triggers>

The problem is the EventName attribute not being recognised. I have searched evrywhere for a comprehensive list of Dropdownlist evcent names but I can't find anything. What I have found hasn't worked.

Am I missibg something else or is it simply a case of the dropdownlist event name being incorrect.

Thanks in advance for your help.

Kind Regards

Mike

i was the same question with you before.

try using EventName = "SelectedIndexChanged"