Showing posts with label postbacks. Show all posts
Showing posts with label postbacks. Show all posts

Wednesday, March 28, 2012

change the mode of a DETAILSVIEW to INSERT mode as soon as a NEW RECORD is inserted in the

Hi, In ASP.NET 2.0 with AJAX, i have a fairly long-size form. I have lots of DETAILSVIEW on screem inside UPDATEPANELS from AJAX. The postbacks occur corrrectly without updating the entire page.

Now, i want to automatically change the mode of a DETAILSVIEW to INSERT mode as soon as a NEW RECORD is inserted in the DETAILSVIEW.

How can i accomplish this ?

Alex

assuming that detailsview will return to readonly mode, you can set following in load_complete (not load)

If DetailsView1.CurrentMode = DetailsViewMode.ReadOnly Then DetailsView1.ChangeMode(DetailsViewMode.Insert)End If

hope this helps.

Jae.

Change content pages of Master Page without Master Page posting back?

so Master + content pages seems like exactly what I want except that they are assembled on postbacks. I am trying to make a site where both Master and Content pages have updatepanels, and the site switches content pages (40+ content pages) without the master page refreshing. Master Pages are assembled on postbacks so I don't think simple master page will work without annoying postbacks. I tried an approach where load content pages inside an Iframe, but the content pages take too long to load becuase each content page loads its own scriptmanager. View/Multiview will probably work but difficult to develop a 40 view multiview, I would rather develop 40 separate aspx pages. Any ideas on making any of these three approaches work well? either fix masterpage postback, or fix Iframe load times, or fix View/Multiview eaase of development?

THanks!

Todd Wilder

I think you are looking at the problem backwards - you have to change the MasterPage of the content page. this.Page.MasterPageFile property.

Another option which I successfuly have deployed is dynamically loading a usercontrol into a placeholder on the masterpage.

Monday, March 26, 2012

catching the postBacks of UserControl inside another UserControl

My problem is that i've got:

MasterPage with a Menu, ScriptManager and a UpdatePanel, inside of wich i've put the the ContentPlaceHolder. I've put the Menu as trigger for the UpdatePanel

In the ContentPage i want to show, i have a UserControl that has inside of itself another UserControl.

Even putting an UpdatePanel in the ContentPage containing the UserControl (Parent), the whole page refreshes instead of been only the ContentPage, due to the UpdatePanel of the MasterPage.

All the UpdatePanels have de UpdateMode as Conditional.

How can i make this work, refreshing only the contentPage or the area pretended of the contentPage?

i've seen other Posts, but they only talk of one UserControl.

Thanks a lot.

You've got two problems:

First, the menu control is not compatible with partial-page updates and therefore not compatible with updatepanel controls.

Second, if you are using a master page, you are going to get a full refreshevery time you load a content page. When you navigate to a content page, you are not just reloading the part of the page that is in the contentplaceholder. You are loading anentire page that is a meshing of the master and content page. So what you are trying to do is not possible. Placing an updatepanel around a contentplaceholder does nothing. Different page = refresh.


thanks for your answer, but what i meant was the case of the usercontrols. the use of them makes me refresh the whole page, even though the content page is inside a update panel, i've tried to put the control inside a updatepanel conditional mode, but it still doesn't work.

this usercontrol was another one inside itself.


See if this article helps:

http://asp.net/ajax/documentation/live/tutorials/UsingUpdatePanelUserControls.aspx