Showing posts with label showing. Show all posts
Showing posts with label showing. Show all posts

Wednesday, March 28, 2012

UpdatePanel - Javascript to create control wont fire

I've got an update panel that functions like tabs, hiding/showing certain controls. One of the controls is rendered via javascript:

<script type="text/javascript" language="JavaScript">
showCategoryBox("Databases", "All Resources");
</script>

This creates a dropdown list to choose from. It works fine when the page loads, but going to other tabs, then coming back to this one causes it to disappear. All of the standard html controls show up fine, but it won't execute this script to create the dropdown.

Any Ideas? Thanks

Coop

Try something like this. The pageLoaded event of the PageRequestManager is raised after every postback, synchronous or asynchronous.

<script type="text/javascript">
var prm = Sys.WebForms.PageRequestManager.getInstance();
prm.add_pageLoaded(onPageLoaded);

function onPageLoaded(sender, args) {
showCategoryBox("Databases", "All Resources");
}
</script>


Thanks. I tried this (and something very similar by using ScriptManager in the cs file) and it just basically only shows this drop down, nothing else on the page shows up. The page starts to render, then everything goes blank and only this shows up at the top.

Wednesday, March 21, 2012

UpdatePanel and Popup

Hi All,

I've a page containing a form divided into 4 steps:

<UpdatePanel>

<Multiview>

<View1>GridView showing students' information

<View2>Form for Add/Edit student's personal info

<View3>form for add/edit student's home info

<View4>form for add/edit student's parents info

</Multiview>

</UpdatePanel>

Every view have a next button to change the active view to the next view and in view4 these is a save button to save the data into database then change the active view to view 1.

In view 2 there is a button popup a window of student's semester subjects list for user to enter their score. My problem is, after I press save button in the popup to save the subject score the parent window autometically refresh and active view change back to View1... How can I make the parent window not refresh when I save the info of popup window?

Thanks,

Tim

What are you using for a popup? You can try using the ModalPopuphttp://www.asp.net/AJAX/Control-Toolkit/Live/ModalPopup/ModalPopup.aspx.

-Damien


Hi Damien,

Because I need to use the FileUploadControl to upload student's project files/exam paper ... this requires a full post back so cannot work inside updatepanel..

Cheers,

Tim


The ModalPopup doesn't require an UpdatePanel.

-Damien