Monday, January 29, 2007

How To Play Undf. File With Mac

Redirecting to another page

order from one to another navigate site offers, we now know the different methods. With ASP.NET mainly four types are used.
- Hyperlinks
- Browser Redirect
- Server Transfer
- Cross-Page Posting

The advantages and disadvantages are here described by Microsoft.


For those who still feel some uncertainty, here are a few additions.

Unless one have to be transferred to the other side no data, the link should be used. Exception if the URL you want to 'hide'.

On the redirect if they are not always possible, as this means an additional round trip.

If data must be exchanged, the two options 'Server Transfer and Cross-Page Posting' into play.
'Cross-Page Posting' is possible in ASP.NET 2.0 and the slightly nicer version. This changes the browser functionality, but not the destination must be wired permanently.
When 'Server Transfer' is a GoBack in the browser is not possible, the dynamic addressing not a problem.
In practice, you realize very quickly that both methods have their Berechtiging and it goes best when a combination of the two options is used.

data transfer: When
'Server Transfer', data on public properties transferred, deployed on the calling page. On the home page can be accessed via the Object Context.Handler.
((page className) Context.Handler). PropertyName

The 'Cross-Page Posting', the fields with FindControl () to read.
((TextBox) ((page className) PreviousPage). FindControl ("MyTextBox ")))). text

This method must be used as the controls are protected. For performance reasons (and OO view) should be dispensed with this method. Similarly, when the 'server transfer' to public properties is carried out, can also avoid difficulties in the use of Master Pages and UserControls arise and with an intermediate step should be resolved through the ContentPlaceHolder.
PrePage = (page className) PreviousPage;.
ContentPlaceHolder c = (ContentPlaceHolder) PrePage Master.FindControl (ContentPlaceHolder1 ");
(((TextBox) (c.FindControl (MyTextBox "))). text



0 comments:

Post a Comment