A new page navigation method

Source: Internet
Author: User
Currently, it is difficult to maintain a Web application and navigate between pages, especially the transmission of parameters between pages. If the writing is poor, it may seem a headache.
There is an opportunity for the manager to make some pages into a mode page. Opening the mode page can only pass one parameter. Of course, this parameter can be an object. However, it is too troublesome to construct many classes to pass parameters.
I thought about the following method and is currently running well. I 'd like to share with you. If there is anything inappropriate, please criticize and correct it.
This method adds a static method for the page class to be opened, such as the MsgInfo. aspx page:
Public static void Open (ParaType1 para1, (ParaType2 para2, string msgInfoUrl, Page thePage)
{
// Open the page
}
The first two are the passed page parameters (of course, multiple are also supported), and the third is the relative url of the page to open the MsgInfo. aspx page relative to MsgInfo. aspx. If you are in the same directory, write MsgInfo. aspx directly. The fourth parameter is the Page object to open the MsgInfo. aspx Page.
Advantages:
Easy to use, just use the MsgInfo. Open (...) method.
Multiple parameters can be passed, which is suitable for opening the mode page.
The passed parameters are strongly typed to avoid unnecessary troubles.

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.