Strange question?

Source: Internet
Author: User
When you use detailsview to edit a value, you can get the value on the page when adding the mode. When you are in edit mode, you cannot get the value.

String M_strsum = Sof. Common. gatewayfactory. getdefault (). fromcustomsql ( " Select count (*) as exercisesum from d_job_arithmeticexercise " ). Todataset (). Tables [ 0 ]. Rows [ 0 ] [ " Exercisesum " ]. Tostring ();
String M_strnormal = Gateway. Count < Arithmeticexercise > (Arithmeticexercise. _. fsort =   " 0 " ). Tostring ();
String M_strartifice = Gateway. Count < Arithmeticexercise > (Arithmeticexercise. _. fsort =   " 1 " ). Tostring ();
Dvarithmeticexampaper. defaultmode =   String . Isnullorempty (fguid) =   True   ? Detailsviewmode. insert: detailsviewmode. Edit;
This . Title = (Dvarithmeticexampaper. defaultmode = Detailsviewmode. Edit) ?   " Modify arithmetic questions " : " Add arithmetic questions " ;
Labelsum. Text = M_strsum;
Labelnormal. Text = M_strnormal;
Labelartifice. Text = M_strartifice; // When editing mode, three labels cannot get the value.

< Edititemtemplate >
< ASP: textbox ID = " Txtfexerciseamount " Cssclass = " Necessarycss " Runat = " Server " Text = ' <% # BIND ("fexerciseamount") %> '
Maxlength = " 3 " Onkeyup = " Value = value. Replace (/[^ \ D]/g ,'') " Value = ' Only numbers can be entered ' Onfocus = " If (value = 'only numbers allowed ') {value = ''} "
Onblur = " Return countvalidate (); " > </ ASP: textbox >
< ASP: regularexpressionvalidator ID = " Regularexpressionvalidator1 " Runat = " Server " Errormessage = " The question Count must be an integer! " Display = " Dynamic "
Controltovalidate = " Txtfexerciseamount " Validationexpression = " [1-9] \ D * " > </ ASP: regularexpressionvalidator >
Total number of questions: < ASP: Label runat = " Server " ID = " Labelsum "   > </ ASP: Label > (Basic questions: < ASP: Label runat = " Server " ID = " Labelnormal " > </ ASP: Label > & Nbsp; & Nbsp; & Nbsp; tips: < ASP: Label runat = " Server " ID = " Labelartifice " > </ ASP: Label > )

</ Edititemtemplate >

Three labels can be assigned to all the values during breakpoint debugging, but the value remains unchanged when the page is displayed.
Have you used all kinds of methods to solve the problem? Paste it in the garden to consult experts.

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.