Showing posts with label property. Show all posts
Showing posts with label property. Show all posts

Wednesday, March 28, 2012

UpdateProgress progress property: UpdatePanelID. Will this ever be available ?

Hi, I was just wondering if will ATLAS ever have this property for UpdateProgress, so this way we could have several UpdateProgress controls, each one showing only with their associated UpdatePanel is being updated. I think it's something "essential" and I'm a bit worried about how this feature is still not available. Maybe is not possible for some reason ??

Eric

hello.

well, i guess this isn't necessary in the current release because you can only have one partial postback at a time. currently, i'd be happy if i was able to get a reference to the updatepanel that started the partial postback (and this is possible because the pagerequestmanager mantains a reference to it internally - it simply doesn't have a property that let's us get that info!


I have a situation where it is necessary. I have two UpdatePanels and would like to show the UpdateProgress on top of my UpdatePanel. If I could associate the UpdateProgress with the UpdatePanel then this would be easy because when the UpdatePanel is sending data back and forth to the server it would show only the appropriate UpdateProgress control.
I'm surprised too why this has not been added yet. It's more intuitive to the user when the loading indicator only appears in the specific section of the page that is updating.
lookherefor a javascript/css solution. have not tried it out yet though.
the noverber CTP has an AssociatedUpdatePanelID property on the UpdateProcess control. This allows you to tell the updateprogress to display when the desired update panel is posting back.

UpdateProgress subcontrols modification

I have the following code in place on my page. What I would like to do is to dynamically set the
lblProcessingRequest Text property during page load, because the site have some local language
customization build in.

I have tried a lot of things, but can't manage to get it to work.

<asp:UpdateProgressID="UpdateProgress"runat="server"AssociatedUpdatePanelID="UpdatePanel"DisplayAfter="100"DynamicLayout="False">

<ProgressTemplate><imgsrc="images/ProcessAnimation.gif"align="absMiddle"> <asp:labelID="lblProcessingRequest"Text="Processing request..."runat="server"Font-Bold="True"></asp:label></ProgressTemplate></asp:UpdateProgress>

The content is a template, so you can't immediately get at the controls like you normally can.

The template is instantiated during PreRender, so you should be able to hook into the Page's PreRenderComplete event, then do a FindControl on the update progress to get to the label:

private void PreRenderCompleteHandler(object sender, EventArgs args) {
Label l = (Label) UpdateProgress.FindControl("lblProcessingRequest");
l.Text = ""; // some localized text
}

Whenever you do this sort of thing, please, please be wary of ViewState. You should disable ViewState on that label, or you will be persisting viewstate data that doesn't need to be. If you are doing this for many labels on the page it could really add up to a problem. Read my (lengthy) article on ViewState, linked in my signature, if you have time.


ProtectedSub Page_PreRender(ByVal senderAsObject,ByVal eAs System.EventArgs)HandlesMe.PreRenderTryCType(UpdateProgress.FindControl("lblProcessingRequest"), Label).Text ="Some local Text"
Catch exAs Exception
EndTryEndSub

Sorry to say that this doesn't work. The control is not found. Couldn't this be because the label only is visible during the UpdateProgress, and at all
other time is hidden? I even tried hooking the control in the UpdateProgress PreRender method, but that didn't work eighter...


Ok, was I litte to hasty here.

Protected

Sub Page_PreRenderComplete(ByVal senderAsObject,ByVal eAs System.EventArgs)HandlesMe.PreRenderComplete

Hooking into the PreRenderComplete works fine!

Saturday, March 24, 2012

Uploadfile behind an UpdatePanel

Hello,

After add an UpdatePanel, I don't have value for property filename of my upload control.

is there a workaround ?

thanks for your help

Hello

If you give look atUpdatpanel documentaion you will see note about that:

You cannot place file upload controls inside of UpdatePanel controls, because the data transfer interferes with partial page updates. File upload controls can be on the same page as UpdatePanel controls, but they must be placed on the page outside of UpdatePanel controls.

I hope this help

Wednesday, March 21, 2012

Use BehaviourID to tell slideshowextender where to start?

Hi all, hope you can help with this. Can anyone tell me if it is possible (and if so how) to use the BehaviourID property to tell the slideshowextender where in the array of slides to start playing? Default behaviour has it starting at the first slide. I want to pass in the name of an image file into the Slideshowextender and have it kick-off the play back starting w/that image, allowing forward navigation (using next button) from that point and backward navigation (using prev button).

I'm betting/hoping/crossing my fingers that BehaviourID is the ticket.

Thanks!

David

Anyone wanna even try?


Is there a better way for me to ask this question? Is there something I can add to make it easier for folks to take a stab at it?


Hi David,

I think you are just a tiny step from finding the answer. Here is a short code snippet may help:

<script type="text/javascript">var slider1;
function pageLoad(){
slider1 = $find("ss1"); // ss1 is the behaviorID
slider1.add_slideChanging(onSlideChanged);
slider1._currentIndex = 1;
}

</script>


FYI... this worked for me, but I had to remove slider1.add_slideChanging(onSlideChanged);

yep... that did it... Thanks for the help!