Ajax Talk - Asynchronous javascript and xml discussion board
 FAQ   Search    Usergroups      Register   Profile   Check your messages   Log in 
Signup now to enjoy a range of free membership advantages !!
Ajax Talk - Moderators Wanted
data across postback

 
Post new topic   Reply to topic    Ajaxtalk.com Forum Index -> AJAX Help
View previous topic :: View next topic  
Author Message
db007
New one
New one


Joined: 10 Apr 2008
Posts: 2

PostPosted: Thu Apr 10, 2008 7:05 pm    Post subject: data across postback Reply with quote

I have a problem at the moment with a web project.

I have two Panels within an UpdatePanel on an aspx page (using Masterpages). I'm using ASP.Net 2.0 with an AJAX enabled website.

The two Panels represent a Master-Detail type relationship. I want a user to click a LinkButton in the first Panel and then for the 2nd Panel to be displayed with the detail.

However, I need to set some text properties of textboxes programmatically when the LinkButton is clicked.

The problem, though, is that the UpdatePanel's Load event fires BEFORE the LinkButton's click event. The data needs to be in the textboxes before the UpdatePanel's Load event fires, as it renders items depending upon this data.

I was wondering if a client-side solution might work?

Is there a way I could wire the "OnClientClick" of the LinkButton to a client-side JavaScript function that would write the appropriate text to a hidden field or other control or variable that could be then read in the code behind when the UpdatePanel's Load event fires?

Or, is there an easier or better way of doing this? Am I missing something on the event sequence for the UpdatePanel??

The linkbutton is in the ItemTemplate of the gridview on each row.

The gridview is in a Panel which is in an UpdatePanel. This is the "master" view, containing a list of data items. The UpdatePanel also contains another Panel. This second panel is the details view, which should display the details of a selected item the user picks from the first panel.

But, both the panels in the UpdatePanel reside in the same space. So, when the user selects an item, the master panel becomes invisible and the details panel is in view.

I want to click on the link button and then view the details in another panel, with the master panel becoming invisible.

The project I am working on is a little different in that an XML datasource is being used via a bespoke provider, so I can't quite link things up the way described above. However, I have tried this with the appropriate adjustment, using the HyperLinkField.

It has been suggested to me to use a HyperLinkField that maps a value to a QueryString parameter. This would certainly work. However, it does not look like it's a suitable solution as there is a more general issue in that this is an AJAX enabled website.

The idea of the UpdatePanel, and the two normal Panels within, is that the transition should be visibly seamless between viewing a list of data items in the master view (in the 1st panel) and the details of a particular selected item in the details view (the 2nd panel).

In other words, it relies upon a partial page postback on the UpdatePanel.

However, when the link for a hyperlink control or hyperlinkfield is clicked, the page is requested as a completely new request and therefore does not cause a postback to occur. This results in the whole page loading again, which is not what is desired here.

The project also uses a masterpage.

The UploadPanel has both Load() and PreRender() events. Within these events is the code that determines which panel is displayed upon a partial page postback. So, prior to the content of these event handlers executing, I need to determine which item was selected from the GridView (each item in the Grid is identified by a unique string ID).

I am now struggling a little with this one. I've been through a few books and am still not getting anywhere. Frustrating.

Any help much appreciated on this.

Thanks - Darren
Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic    Ajaxtalk.com Forum Index -> AJAX Help All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
 Advertisements
 XML & Copyright Notice 
    


Powered by phpBB © 2001, 2005 phpBB Group

What is according to Wikipedia: Ajax Web2.0 XML E4X


Link to our site:

  


del.icio.us digg spurl wists simpy newsvine blinklist furl blogmarks yahoo! myweb smarking ma.gnolia segnalo reddit fark technorati cosmos


Normal Bookmark


Partner Button Links:
Codecrunch.com: Webmaster Tutorials    One Ajax


Partner Text Links:
quomon | web20log | ajaxmatters | tableless | 456bereastreet | music charts | gift ideas | competitions | free xbox 360 | link trade ?


Credits:
it consultancy & project management lead generation zoekmachine optimalisatie steal these buttons seo expert