Asp.net frontend and backend value call

Source: Internet
Author: User

first, describe the usage of ASP in the past, which is also used in Asp.net. <% # %> is a usage introduced in Asp.net, this usage is not used in ASP.

example:
for example, form. in VB, I define a variable (to be global)
Public istg_xo as string = "ABC"
so I am at the front end from. this variable can be used anywhere in aspx ....

var xx = <% = istg_xo %>
alter

Another example: If I have a datatable in the background, I want to retrieve the changes of the field in this datatable in the foreground in sequence...
Background. CS (C #)
String message = string. empty;
Public getmessage ()
{
For (INT lint_row = 0; lint_row <datatable. Rows. Count; lint_row ++)
{
Message + = "Message [" + lint_row.tostring () + "] =" + idtb_temp.rows (lint_rows). Item ("xx1"). tostring () + ";";
// Generate the number of client messages for the front-end users...
}
}

The frontend uses the same method to retrieve this data group ....

The usage of <% # %> is simpler than that of other .....
For example, if I have a dataset... on the backend, I can use the content of any field in this dataset...
Usage:
TEXT = '<% # databinder. eval (container. dataitem, "dataset field name" %>'

Related Article

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.