How to assign a value to asp.net mvc after it loads an ascx

Source: Internet
Author: User

Insus.net has written a "asp.net mvc display UserControl control (extension)" http://www.cnblogs.com/insus/p/3642634.html, has not finished this article, there are netizens asked, how to interact. This interaction refers to the problem of assigning values and getting them.

The insus.net to demonstrate an example of assigning values to controls within ascx after ASP.net mvc loads a user control (ascx).

To assign values to ascx, you can first refer to the user control (ASCX) property assignment http://www.cnblogs.com/insus/p/3154363.html. We can use the MVC application as a minor modification.

Open the AscxUtility.cs class in the Utilities directory, add a method rendercontrol<t> (), and overload it by passing in different parameters. Look at the detailed code:

More Wonderful content: http://www.bianceng.cnhttp://www.bianceng.cn/webkf/aspx/

In the Aspnets directory, create a user control that simply demonstrates that Insus.net pulls a TextBox control in ascx:

. Ascx.cs:

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.