Database component Hxj.data (30) (ASP.net page is automatically assigned and evaluated)

Source: Internet
Author: User

In the project page often encounter the interface of assignment and value, especially when the page is very much, the value and assignment is often physical work.

A simple helper is added to the component, the value is implemented by request.from[""], and the assignment is document.getElementById (""). Value to implement.

Let's look at the sample code below:

Examples are: Northwind database Products table

Page code:

<! DOCTYPE HTML PUBLIC "-//W3C//DTD XHTML 1.0 transitional//en" "Http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd
<title></ Title>
<body>
<form id= "Form1" runat= "Server"
Productname:<asp: TextBox runat= "Server" id= "Txt_productname" ></asp:textbox><br/>
Supplierid:<asp:textbox runat= "Server" id= "Txt_supplierid" ></asp:textbox><br/>
Categoryid:<asp:textbox runat= " Server "id=" Txt_categoryid ></asp:textbox><br/>
quantityperunit:<asp:textbox runat= "Server" Id= "Txt_quantityperunit" ></asp:textbox><br/>
unitprice:<asp:textbox runat= "Server" ID= "Txt_" UnitPrice "></asp:textbox><br/>
Unitsinstock:<asp:textbox runat=" Server "ID=" Txt_ UnitsInStock "></asp:textbox><br/>
Unitsonorder:<asp:textbox runat=" sErver "id=" Txt_unitsonorder ></asp:textbox><br/>
reorderlevel:<asp:textbox runat= "Server" ID = "Txt_reorderlevel" ></asp:textbox><br/>
Discontinued:<asp:checkbox ID= "txt_Discontinued" runat= "Server"/><br/>
<asp:button id= "Button1" runat= "server" text= "commits insert" onclick= "button1_ Click/>
<asp:gridview id= "GridView" runat= "server"
</asp:gridview>
</form>
</body>

Background Assignment Code:

Products Product = dbsession.default.from<products> (). Tofirst ();

Entityutils.setdocumentvalue<products> (Product, "Txt_");

Then look at the execution effect:

The value has been assigned successfully.

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.