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.