locked
FormView doesn't update when save button clicked RRS feed

  • Question

  • User1427392799 posted

    Hi

     

    I had a problem with a formview control.  It would not update data, even when the data was correct.  The user clicked the save button.  The save button issued the update command.  The formview kicked into action (I could see it in debug mode, clicking over, doing all sorts of marvelous things).  No errors were returned.   But the changed data was not saved.

     

    After a bit of investigating, I found the solution.  I thought I'd share it here, since it's probably quite a common problem.

     

    The problem was that I had Formview automatically create the updatecommand for me.

     

    that's really nifty because it saves tons of time, especially when there are many, many fields in your formview.

     

    However, the formview updatecommand that was automatically created had a syntax as follows

     

    UPDATE table SET field1=@field1, field2=@field2, ..., fieldn=@fieldn WHERE field1=@original_field1, field2=@original_field2, ..., fieldn=@original_fieldn

     

    this works well in most simple cases.  But where your data involves multiple data types, and many fields that might be left blank, then the "original" value stored in the @original parameters might not end up matching the database values.  I imagine, though am not 100% sure, that this is something to do with data types.

     

    Nevertheless, in my case the problem was easily solved by altering the WHERE clause in the UPDATECOMMAND

    I removed all the WHERE clauses and left only the PRIMARY KEY clauses, so my final update command appeared as follows...

    UPDATE table SET field1=@field1, field2=@field2, ..., fieldn=@fieldn WHERE field1=@original_field1

    (Field1 is the primary key of our table.)

     

    Hope this helps others.

     

    Cheers!

    Thursday, March 29, 2007 11:13 PM

All replies

  • User706490138 posted

    I've been having the same problem .. your post saved me.  I can now do edits! 

    [Yes] 

    I also made the change to the DeleteCommand line to allow deletes.  Thank you very much for posting this.

    Monday, April 2, 2007 1:03 PM
  • User323246212 posted
    At last... thank you! [Yes]
    Sunday, April 22, 2007 6:37 PM
  • User-1910556736 posted

    Hi,

     

    I want to update a record in a SQL server table through FormView by using RadioButtonList. but when I click on Update button but data actually don't get update. The old value appears.

    I was searching a solution for this, but i couldn't find any solution. Can you please help me in this regard.

     

    Looking for your help.

    Best Regards,

    Wednesday, August 4, 2010 6:28 AM
  • User-469252126 posted
    since adding/inserting  image is not working that why i have given the page source in html layout



    when i run the aspx page its look like this

    <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

    <html xmlns="http://www.w3.org/1999/xhtml" >
    <head><title>
    Untitled Page
    </title></head>
    <body>
    <form name="form1" method="post" action="radio.aspx" id="form1">
    <div>
    <input type="hidden" name="__EVENTTARGET" id="__EVENTTARGET" value="" />
    <input type="hidden" name="__EVENTARGUMENT" id="__EVENTARGUMENT" value="" />
    <input type="hidden" name="__VIEWSTATE" id="__VIEWSTATE" value="c9trXLZ6Rf0GbCPz07R4Z9IR2TEWBlH1wH/+KtuxBIXFvAKWIiYNWFfNMwWTLVIahbxbF3B7w1fOy2RuQUMiyuGwBCJnK8r/k833Cz+2YcyfFrUlgMHPw1Vu3Fz4NLmxmsyUNjzMOJx5kAcXR7HIN2YQbORZVqRO4RkSvD2cYb558hfdhtZgjUKLTQvwD5ehJoplMZkGUNiPCaCbYZcCsYRp/qWx9GmReWVTWPlFCPvMV6BcLzJlHdSBHwbLyDfkCy4EqIapNM8CoYKi0+Zq6ILKwgBSOkS9NetMx1dk9692Okg5IUEDnpxqoAKaQbhBFhsjrXRhnAMLUwa0NheHReNeHl6DO9PNfDQ3VMNXTa7hn04F2R/x7LgmdCBDixF66tKjdlMQxqSr54t3FqqT2w5SE9Q6c4nWNkl+0dMJ8iKj8qD3G0eKzMiOOVudW0EBGta/nq1iHnrruMDO+iOUnmpbQZFaoOHwO4901zGzaJ6s1PZ9rd7flmwqE/St4VeMETiLn99tJWs3FPmeltJgUCuLl0BL+vVP4haLpAqdYjg=" />
    </div>

    <script type="text/javascript">
    //<![CDATA[
    var theForm = document.forms['form1'];
    if (!theForm) {
    theForm = document.form1;
    }
    function __doPostBack(eventTarget, eventArgument) {
    if (!theForm.onsubmit || (theForm.onsubmit() != false)) {
    theForm.__EVENTTARGET.value = eventTarget;
    theForm.__EVENTARGUMENT.value = eventArgument;
    theForm.submit();
    }
    }
    //]]>
    </script>


    <div>

    <input type="hidden" name="__VIEWSTATEENCRYPTED" id="__VIEWSTATEENCRYPTED" value="" />
    <input type="hidden" name="__EVENTVALIDATION" id="__EVENTVALIDATION" value="Z0LIdzD7rD/XgQbC9ObS981VDWPFnqm0/P+pWTBGLzsKA/8s2gvky44RRPFpr3F9WYTA9ebPKP7lfNyZzP7jbw==" />
    </div>
    <div>
    &nbsp;
    <input name="TextBox1" type="text" value="12" id="TextBox1" style="z-index: 100; left: 248px; ;
    top: 148px"
    />
    <input type="submit" name="Button2" value="Button" id="Button2" style="z-index: 101; left: 253px; ;
    top: 188px"
    />
            &nbsp;

    </div>
    <table cellspacing="0" border="0" id="FormView1" style="height:156px;width:140px;border-collapse:collapse;z-index: 102; left: 92px; ; top: 187px">
    <tr>
    <td colspan="2">
    c:
    <span id="FormView1_cLabel">honda cardillod</span><br />
    a:
    <span id="FormView1_aLabel">12</span><br />
                    <a id="FormView1_EditButton" href="javascript:__doPostBack('FormView1$EditButton','')">Edit</a>
    <a id="FormView1_DeleteButton" href="javascript:__doPostBack('FormView1$DeleteButton','')">Delete</a>
    <a id="FormView1_NewButton" href="javascript:__doPostBack('FormView1$NewButton','')">New</a>
    </td>
    </tr>
    </table>


    <table cellspacing="0" border="0" id="FormView2" style="border-collapse:collapse;z-index: 103; left: 421px; ; top: 27px">
    <tr>
    		<td colspan="2">
    c:
    <span id="FormView2_cLabel">honda cardillod</span><br />
    a:
    <span id="FormView2_aLabel">12</span><br />
    <a id="FormView2_EditButton" href="javascript:__doPostBack('FormView2$EditButton','')">Edit</a>
    <a id="FormView2_DeleteButton" href="javascript:__doPostBack('FormView2$DeleteButton','')">Delete</a>
    <a id="FormView2_NewButton" href="javascript:__doPostBack('FormView2$NewButton','')">New</a>
                </td>
    </tr>
    </table>

    </form>
    </body>
    </html>
    while changing to other value

    <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

    <html xmlns="http://www.w3.org/1999/xhtml" >
    <head><title>
    Untitled Page
    </title></head>
    <body>
    <form name="form1" method="post" action="radio.aspx" id="form1">
    <div>
    <input type="hidden" name="__EVENTTARGET" id="__EVENTTARGET" value="" />
    <input type="hidden" name="__EVENTARGUMENT" id="__EVENTARGUMENT" value="" />
    <input type="hidden" name="__VIEWSTATE" id="__VIEWSTATE" value="c9trXLZ6Rf0GbCPz07R4Z9IR2TEWBlH1wH/+KtuxBIXFvAKWIiYNWFfNMwWTLVIahbxbF3B7w1fOy2RuQUMiyuGwBCJnK8r/k833Cz+2YcyfFrUlgMHPw1Vu3Fz4NLmxmsyUNjzMOJx5kAcXR7HIN2YQbORZVqRO4RkSvD2cYb558hfdhtZgjUKLTQvwD5ehJoplMZkGUNiPCaCbYZcCsYRp/qWx9GmReWVTWPlFCPvMV6BcLzJlHdSBHwbLyDfkCy4EqIapNM8CoYKi0+Zq6ILKwgBSOkS9NetMx1dk96+xkv/rzRyBfmFBL/bbpQVtgnpjmR2npmLFrYnnuQNDFQFcHF3YyMcmP6rmvOv7OA65v/W5Wcku7NjxBD3gakPl1U7ZmfsL0KJZ+odt+iJ3pXe9iJBvWGcEOowZAyBVkoCkwfDIO4M65uvvdhN4xRmgYgzjPX5L6SoDlA5WPdtl1z+mpmkmpeqi54Zdw0J8t7yTBLucZwJew5uZ5JfbX1AW892jbD3crDR9LZxLnRi2a0N5nT2sbgRHDG8Dm2AAxwTlbz8M/lxC/LGgye8WAVqgk7DVsC3iq6DdMRuks0r0XT0AiaHPHGJQRvv5/g1Ig4AFAaOt7w3/rymQxrSPoy/wwgSXAWPUOUmvZkxKZVFYxSDnlEa8YwBgNFSh4uQTjoKJzvS70jimJ7+PXAGbtpV7LlUSwPAkOmeXf0SIMDShf3PFueJCKXH12Tu8eiVGuvqacY1xvKP0E96WaXF3xXJRMZPSClfc9gTlb7N5O67OjuLFyPAJsgRpdOaD5oYO65xfPdCH6Wp8njt54zowF/mDqf0RFa5YPUg3bYmkurEQn6KL7HyxbqMNeAxDl2GxomDSvUtVzblm12nHrTt4euk/Z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x+ucmoWWY9XM/bEtOPae/xJqRlEWtD5i13zvQ9I/MljiUU5dMrAD39AS+KcKbJFqLU=" />
    </div>

    <script type="text/javascript">
    //<![CDATA[
    var theForm = document.forms['form1'];
    if (!theForm) {
    theForm = document.form1;
    }
    function __doPostBack(eventTarget, eventArgument) {
    if (!theForm.onsubmit || (theForm.onsubmit() != false)) {
    theForm.__EVENTTARGET.value = eventTarget;
    theForm.__EVENTARGUMENT.value = eventArgument;
    theForm.submit();
    }
    }
    //]]>
    </script>


    <div>

    <input type="hidden" name="__VIEWSTATEENCRYPTED" id="__VIEWSTATEENCRYPTED" value="" />
    <input type="hidden" name="__EVENTVALIDATION" id="__EVENTVALIDATION" value="eXLYzUZ/Iw9ZW2tNWa8gjJrceeYLZUu3XVG2ej977c0Gl0iFYBjdh+7kSo8GJ6vi5nPvDkihl4nX53Xfcpz6U4Pb9HVqjxjIN42rvPPssmCGKojv8h/8M5XRJsp6pRjVKJKfNobCo4KBv/HfcFPmmsD0IfXSRJUL9Ol/UmBNJtMOBFyRUmLUtulbAxNTo+MOkJRqfWwWdmHeieHtKLqlXSjSQq+MSt5kEjYTWRBuwuuD/5yM9fmr+xLQdRuD/viZgUhrctiwZfgh45pY/oqOw5h1V1RpIOrutjKA1IKXvTUMXR3BxnaEdLm6UBuTnobORAKdNmCmYY3st0fKJRwI7iafrXg3U7x2a554pUQUuK8SMXm6nNm4Ops0WCQgz23ejgs8Cf6SPkWWncLsbiAxWXgmWeyzqUPRMv7ZN69mWW8S86kIzNIrlrxtU18c0jTx+5kFEro2T45uVMO6NuiplLQPvU3R8/DYwJ/+KTvrGBJGS/t0mb9nNGOHS//feZmOI81rAwCxqcCe0Gk3dZl97owtJTieJIf/UpRcZHwzSA2OIueJXOwDxNxnk0bcM9I5iwSwae6cuQ84KLSFTCV/JhnuwLiutbao2DLUPNSrHuy33f/3DxCsq9FBSiPNOOIsXZ+v8+WasB6Nacwp75q4uPB+1gcR+q70rj1++cI/kMJpPcK9biNHFV8Ba/ruhfslMTxN2ztuRmyM1YMwSg/2XprX8Qok1iExTl5AfE2Is9s=" />
    </div>
    <div>
    &nbsp;
    <input name="TextBox1" type="text" value="12" id="TextBox1" style="z-index: 100; left: 248px; ;
    top: 148px"
    />
    <input type="submit" name="Button2" value="Button" id="Button2" style="z-index: 101; left: 253px; ;
    top: 188px"
    />
            &nbsp;

    </div>
    <table cellspacing="0" border="0" id="FormView1" style="height:156px;width:140px;border-collapse:collapse;z-index: 102; left: 92px; ; top: 187px">
    <tr>
    <td colspan="2">
    c:
    <span id="FormView1_cLabel">honda cardillod</span><br />
    a:
    <span id="FormView1_aLabel">12</span><br />
                    <a id="FormView1_EditButton" href="javascript:__doPostBack('FormView1$EditButton','')">Edit</a>
    <a id="FormView1_DeleteButton" href="javascript:__doPostBack('FormView1$DeleteButton','')">Delete</a>
    <a id="FormView1_NewButton" href="javascript:__doPostBack('FormView1$NewButton','')">New</a>
    </td>
    </tr>
    </table>


    <table cellspacing="0" border="0" id="FormView2" style="border-collapse:collapse;z-index: 103; left: 421px; ; top: 27px">
    <tr>
    		<td colspan="2">
    c:
    <table id="FormView2_cTextBox" border="0">
    <tr>
    <td><input id="FormView2_cTextBox_0" type="radio" name="FormView2$cTextBox" value="porseche 911" /><label for="FormView2_cTextBox_0">porseche 911</label></td>
    </tr><tr>
    <td><input id="FormView2_cTextBox_1" type="radio" name="FormView2$cTextBox" value="nissan GTO" /><label for="FormView2_cTextBox_1">nissan GTO</label></td>
    </tr><tr>
    				<td><input id="FormView2_cTextBox_2" type="radio" name="FormView2$cTextBox" value="honda cardillod" checked="checked" /><label for="FormView2_cTextBox_2">honda cardillod</label></td>
    </tr><tr>
    <td><input id="FormView2_cTextBox_3" type="radio" name="FormView2$cTextBox" value="" /></td>
    </tr><tr>
    <td><input id="FormView2_cTextBox_4" type="radio" name="FormView2$cTextBox" value="as" /><label for="FormView2_cTextBox_4">as</label></td>
    </tr><tr>
    <td><input id="FormView2_cTextBox_5" type="radio" name="FormView2$cTextBox" value="sasxeeeeeeeeedc" /><label for="FormView2_cTextBox_5">sasxeeeeeeeeedc</label></td>
    			</tr><tr>
    <td><input id="FormView2_cTextBox_6" type="radio" name="FormView2$cTextBox" value="sd" /><label for="FormView2_cTextBox_6">sd</label></td>
    </tr><tr>
    <td><input id="FormView2_cTextBox_7" type="radio" name="FormView2$cTextBox" value="erasdf" /><label for="FormView2_cTextBox_7">erasdf</label></td>
    </tr><tr>
    <td><input id="FormView2_cTextBox_8" type="radio" name="FormView2$cTextBox" value="djtjtkjktjktkkjkj" /><label for="FormView2_cTextBox_8">djtjtkjktjktkkjkj</label></td>
    </tr><tr>
    				<td><input id="FormView2_cTextBox_9" type="radio" name="FormView2$cTextBox" value="wadddd" /><label for="FormView2_cTextBox_9">wadddd</label></td>
    </tr><tr>
    <td><input id="FormView2_cTextBox_10" type="radio" name="FormView2$cTextBox" value="sd" /><label for="FormView2_cTextBox_10">sd</label></td>
    </tr><tr>
    <td><input id="FormView2_cTextBox_11" type="radio" name="FormView2$cTextBox" value="sd" /><label for="FormView2_cTextBox_11">sd</label></td>
    </tr><tr>
    <td><input id="FormView2_cTextBox_12" type="radio" name="FormView2$cTextBox" value="sdsdf" /><label for="FormView2_cTextBox_12">sdsdf</label></td>
    			</tr><tr>
    <td><input id="FormView2_cTextBox_13" type="radio" name="FormView2$cTextBox" value="asasa" /><label for="FormView2_cTextBox_13">asasa</label></td>
    </tr><tr>
    <td><input id="FormView2_cTextBox_14" type="radio" name="FormView2$cTextBox" value="http://ask.com huehuer" /><label for="FormView2_cTextBox_14">http://ask.com huehuer</label></td>
    </tr><tr>
    <td><input id="FormView2_cTextBox_15" type="radio" name="FormView2$cTextBox" value="as" /><label for="FormView2_cTextBox_15">as</label></td>
    </tr><tr>
    				<td><input id="FormView2_cTextBox_16" type="radio" name="FormView2$cTextBox" value="http://ask.com" /><label for="FormView2_cTextBox_16">http://ask.com</label></td>
    </tr><tr>
    <td><input id="FormView2_cTextBox_17" type="radio" name="FormView2$cTextBox" value="http://ask.com" /><label for="FormView2_cTextBox_17">http://ask.com</label></td>
    </tr><tr>
    <td><input id="FormView2_cTextBox_18" type="radio" name="FormView2$cTextBox" value="http://ask.com" /><label for="FormView2_cTextBox_18">http://ask.com</label></td>
    </tr><tr>
    <td><input id="FormView2_cTextBox_19" type="radio" name="FormView2$cTextBox" value="http://ask.comasas" /><label for="FormView2_cTextBox_19">http://ask.comasas</label></td>
    			</tr><tr>
    <td><input id="FormView2_cTextBox_20" type="radio" name="FormView2$cTextBox" value="http://ask.com" /><label for="FormView2_cTextBox_20">http://ask.com</label></td>
    </tr><tr>
    <td><input id="FormView2_cTextBox_21" type="radio" name="FormView2$cTextBox" value="http://ASK.com" /><label for="FormView2_cTextBox_21">http://ASK.com</label></td>
    </tr><tr>
    <td><input id="FormView2_cTextBox_22" type="radio" name="FormView2$cTextBox" value="http://ASK.com" /><label for="FormView2_cTextBox_22">http://ASK.com</label></td>
    </tr><tr>
    				<td><input id="FormView2_cTextBox_23" type="radio" name="FormView2$cTextBox" value="http://ASK.com" /><label for="FormView2_cTextBox_23">http://ASK.com</label></td>
    </tr><tr>
    <td><input id="FormView2_cTextBox_24" type="radio" name="FormView2$cTextBox" value="a" /><label for="FormView2_cTextBox_24">a</label></td>
    </tr><tr>
    <td><input id="FormView2_cTextBox_25" type="radio" name="FormView2$cTextBox" value="as" /><label for="FormView2_cTextBox_25">as</label></td>
    </tr><tr>
    <td><input id="FormView2_cTextBox_26" type="radio" name="FormView2$cTextBox" value="asasa" /><label for="FormView2_cTextBox_26">asasa</label></td>
    			</tr><tr>
    <td><input id="FormView2_cTextBox_27" type="radio" name="FormView2$cTextBox" value="S555SSSSSSSSSSSSSSS" /><label for="FormView2_cTextBox_27">S555SSSSSSSSSSSSSSS</label></td>
    </tr><tr>
    <td><input id="FormView2_cTextBox_28" type="radio" name="FormView2$cTextBox" value="sssSSS" /><label for="FormView2_cTextBox_28">sssSSS</label></td>
    </tr><tr>
    <td><input id="FormView2_cTextBox_29" type="radio" name="FormView2$cTextBox" value="ssssss" /><label for="FormView2_cTextBox_29">ssssss</label></td>
    </tr><tr>
    				<td><input id="FormView2_cTextBox_30" type="radio" name="FormView2$cTextBox" value="sss555555" /><label for="FormView2_cTextBox_30">sss555555</label></td>
    </tr><tr>
    <td><input id="FormView2_cTextBox_31" type="radio" name="FormView2$cTextBox" value="sdsdsassssssss" /><label for="FormView2_cTextBox_31">sdsdsassssssss</label></td>
    </tr><tr>
    <td><input id="FormView2_cTextBox_32" type="radio" name="FormView2$cTextBox" value="http://bing.com" /><label for="FormView2_cTextBox_32">http://bing.com</label></td>
    </tr><tr>
    <td><input id="FormView2_cTextBox_33" type="radio" name="FormView2$cTextBox" value="asasasasasas" /><label for="FormView2_cTextBox_33">asasasasasas</label></td>
    			</tr><tr>
    <td><input id="FormView2_cTextBox_34" type="radio" name="FormView2$cTextBox" value="sdsd" /><label for="FormView2_cTextBox_34">sdsd</label></td>
    </tr><tr>
    <td><input id="FormView2_cTextBox_35" type="radio" name="FormView2$cTextBox" value="uiui" /><label for="FormView2_cTextBox_35">uiui</label></td>
    </tr><tr>
    <td><input id="FormView2_cTextBox_36" type="radio" name="FormView2$cTextBox" value="a" /><label for="FormView2_cTextBox_36">a</label></td>
    </tr><tr>
    				<td><input id="FormView2_cTextBox_37" type="radio" name="FormView2$cTextBox" value="asasasasasas" /><label for="FormView2_cTextBox_37">asasasasasas</label></td>
    </tr><tr>
    <td><input id="FormView2_cTextBox_38" type="radio" name="FormView2$cTextBox" value="ford escort" /><label for="FormView2_cTextBox_38">ford escort</label></td>
    </tr><tr>
    <td><input id="FormView2_cTextBox_39" type="radio" name="FormView2$cTextBox" value="toyota camryl" /><label for="FormView2_cTextBox_39">toyota camryl</label></td>
    </tr><tr>
    <td><input id="FormView2_cTextBox_40" type="radio" name="FormView2$cTextBox" value="aston martin" /><label for="FormView2_cTextBox_40">aston martin</label></td>
    			</tr><tr>
    <td><input id="FormView2_cTextBox_41" type="radio" name="FormView2$cTextBox" value="WWWW555555555W" /><label for="FormView2_cTextBox_41">WWWW555555555W</label></td>
    </tr><tr>
    <td><input id="FormView2_cTextBox_42" type="radio" name="FormView2$cTextBox" value="we" /><label for="FormView2_cTextBox_42">we</label></td>
    </tr><tr>
    <td><input id="FormView2_cTextBox_43" type="radio" name="FormView2$cTextBox" value="wewe" /><label for="FormView2_cTextBox_43">wewe</label></td>
    </tr><tr>
    				<td><input id="FormView2_cTextBox_44" type="radio" name="FormView2$cTextBox" value="sd" /><label for="FormView2_cTextBox_44">sd</label></td>
    </tr><tr>
    <td><input id="FormView2_cTextBox_45" type="radio" name="FormView2$cTextBox" value="sdsd" /><label for="FormView2_cTextBox_45">sdsd</label></td>
    </tr><tr>
    <td><input id="FormView2_cTextBox_46" type="radio" name="FormView2$cTextBox" value="asasasasassssssssssss" /><label for="FormView2_cTextBox_46">asasasasassssssssssss</label></td>
    </tr><tr>
    <td><input id="FormView2_cTextBox_47" type="radio" name="FormView2$cTextBox" value="y" /><label for="FormView2_cTextBox_47">y</label></td>
    			</tr><tr>
    <td><input id="FormView2_cTextBox_48" type="radio" name="FormView2$cTextBox" value="we" /><label for="FormView2_cTextBox_48">we</label></td>
    </tr><tr>
    <td><input id="FormView2_cTextBox_49" type="radio" name="FormView2$cTextBox" value="waca waca" /><label for="FormView2_cTextBox_49">waca waca</label></td>
    </tr><tr>
    <td><input id="FormView2_cTextBox_50" type="radio" name="FormView2$cTextBox" value="qwqwqwqwq" /><label for="FormView2_cTextBox_50">qwqwqwqwq</label></td>
    </tr><tr>
    				<td><input id="FormView2_cTextBox_51" type="radio" name="FormView2$cTextBox" value="asa" /><label for="FormView2_cTextBox_51">asa</label></td>
    </tr><tr>
    <td><input id="FormView2_cTextBox_52" type="radio" name="FormView2$cTextBox" value="wwwwwwwwwwwwwww" /><label for="FormView2_cTextBox_52">wwwwwwwwwwwwwww</label></td>
    </tr><tr>
    <td><input id="FormView2_cTextBox_53" type="radio" name="FormView2$cTextBox" value="a" /><label for="FormView2_cTextBox_53">a</label></td>
    </tr><tr>
    <td><input id="FormView2_cTextBox_54" type="radio" name="FormView2$cTextBox" value="toyota spinach" /><label for="FormView2_cTextBox_54">toyota spinach</label></td>
    			</tr><tr>
    <td><input id="FormView2_cTextBox_55" type="radio" name="FormView2$cTextBox" value="dsdsd" /><label for="FormView2_cTextBox_55">dsdsd</label></td>
    </tr><tr>
    <td><input id="FormView2_cTextBox_56" type="radio" name="FormView2$cTextBox" value="sdd55555555ddddddddddddddddddddddddd" /><label for="FormView2_cTextBox_56">sdd55555555ddddddddddddddddddddddddd</label></td>
    </tr><tr>
    <td><input id="FormView2_cTextBox_57" type="radio" name="FormView2$cTextBox" value="sdsdsdsdsdsdsdsdsdsdsd" /><label for="FormView2_cTextBox_57">sdsdsdsdsdsdsdsdsdsdsd</label></td>
    </tr><tr>
    				<td><input id="FormView2_cTextBox_58" type="radio" name="FormView2$cTextBox" value="sdsdsd" /><label for="FormView2_cTextBox_58">sdsdsd</label></td>
    </tr><tr>
    <td><input id="FormView2_cTextBox_59" type="radio" name="FormView2$cTextBox" value="sdsdsd" /><label for="FormView2_cTextBox_59">sdsdsd</label></td>
    </tr><tr>
    <td><input id="FormView2_cTextBox_60" type="radio" name="FormView2$cTextBox" value="sssss" /><label for="FormView2_cTextBox_60">sssss</label></td>
    </tr><tr>
    <td><input id="FormView2_cTextBox_61" type="radio" name="FormView2$cTextBox" value="asa" /><label for="FormView2_cTextBox_61">asa</label></td>
    			</tr><tr>
    <td><input id="FormView2_cTextBox_62" type="radio" name="FormView2$cTextBox" value="asaasas" /><label for="FormView2_cTextBox_62">asaasas</label></td>
    </tr><tr>
    <td><input id="FormView2_cTextBox_63" type="radio" name="FormView2$cTextBox" value="AAAAAA" /><label for="FormView2_cTextBox_63">AAAAAA</label></td>
    </tr><tr>
    <td><input id="FormView2_cTextBox_64" type="radio" name="FormView2$cTextBox" value="AAAAAA" /><label for="FormView2_cTextBox_64">AAAAAA</label></td>
    </tr><tr>
    				<td><input id="FormView2_cTextBox_65" type="radio" name="FormView2$cTextBox" value="honda cardillod" /><label for="FormView2_cTextBox_65">honda cardillod</label></td>
    </tr><tr>
    <td><input id="FormView2_cTextBox_66" type="radio" name="FormView2$cTextBox" value="sss555555sssssssssssssss" /><label for="FormView2_cTextBox_66">sss555555sssssssssssssss</label></td>
    </tr><tr>
    <td><input id="FormView2_cTextBox_67" type="radio" name="FormView2$cTextBox" value="tiger is ferocious of course" /><label for="FormView2_cTextBox_67">tiger is ferocious of course</label></td>
    </tr><tr>
    <td><input id="FormView2_cTextBox_68" type="radio" name="FormView2$cTextBox" value="AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA" /><label for="FormView2_cTextBox_68">AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA</label></td>
    			</tr><tr>
    <td><input id="FormView2_cTextBox_69" type="radio" name="FormView2$cTextBox" value="AAAAAA" /><label for="FormView2_cTextBox_69">AAAAAA</label></td>
    </tr><tr>
    <td><input id="FormView2_cTextBox_70" type="radio" name="FormView2$cTextBox" value="1" /><label for="FormView2_cTextBox_70">1</label></td>
    </tr><tr>
    <td><input id="FormView2_cTextBox_71" type="radio" name="FormView2$cTextBox" value="AAAAAA" /><label for="FormView2_cTextBox_71">AAAAAA</label></td>
    </tr><tr>
    				<td><input id="FormView2_cTextBox_72" type="radio" name="FormView2$cTextBox" value="mazda M7i" /><label for="FormView2_cTextBox_72">mazda M7i</label></td>
    </tr><tr>
    <td><input id="FormView2_cTextBox_73" type="radio" name="FormView2$cTextBox" value="1" /><label for="FormView2_cTextBox_73">1</label></td>
    </tr><tr>
    <td><input id="FormView2_cTextBox_74" type="radio" name="FormView2$cTextBox" value="A" /><label for="FormView2_cTextBox_74">A</label></td>
    </tr><tr>
    <td><input id="FormView2_cTextBox_75" type="radio" name="FormView2$cTextBox" value="lambhorghini 5l 2" /><label for="FormView2_cTextBox_75">lambhorghini 5l 2</label></td>
    			</tr><tr>
    <td><input id="FormView2_cTextBox_76" type="radio" name="FormView2$cTextBox" value="sydgysgd" /><label for="FormView2_cTextBox_76">sydgysgd</label></td>
    </tr><tr>
    <td><input id="FormView2_cTextBox_77" type="radio" name="FormView2$cTextBox" value="ssssssssssssssssssssssssssssssssssssssssssssssssss" /><label for="FormView2_cTextBox_77">ssssssssssssssssssssssssssssssssssssssssssssssssss</label></td>
    </tr><tr>
    <td><input id="FormView2_cTextBox_78" type="radio" name="FormView2$cTextBox" value="dd" /><label for="FormView2_cTextBox_78">dd</label></td>
    </tr><tr>
    				<td><input id="FormView2_cTextBox_79" type="radio" name="FormView2$cTextBox" value="AAAAAA" /><label for="FormView2_cTextBox_79">AAAAAA</label></td>
    </tr><tr>
    <td><input id="FormView2_cTextBox_80" type="radio" name="FormView2$cTextBox" value="wadddd" /><label for="FormView2_cTextBox_80">wadddd</label></td>
    </tr><tr>
    <td><input id="FormView2_cTextBox_81" type="radio" name="FormView2$cTextBox" value="sdsdsdsdsd" /><label for="FormView2_cTextBox_81">sdsdsdsdsd</label></td>
    </tr><tr>
    <td><input id="FormView2_cTextBox_82" type="radio" name="FormView2$cTextBox" value="http://bing.com" /><label for="FormView2_cTextBox_82">http://bing.com</label></td>
    			</tr>
    </table><br />
    a:
    <span id="FormView2_aLabel1">12</span><br />
    <a id="FormView2_UpdateButton" href="javascript:__doPostBack('FormView2$UpdateButton','')">Update</a>
    <a id="FormView2_UpdateCancelButton" href="javascript:__doPostBack('FormView2$UpdateCancelButton','')">Cancel</a>
    </td>
    </tr>
    </table>

    </form>
    </body>
    </html>
    final updation done

    <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

    <html xmlns="http://www.w3.org/1999/xhtml" >
    <head><title>
    Untitled Page
    </title></head>
    <body>
    <form name="form1" method="post" action="radio.aspx" id="form1">
    <div>
    <input type="hidden" name="__EVENTTARGET" id="__EVENTTARGET" value="" />
    <input type="hidden" name="__EVENTARGUMENT" id="__EVENTARGUMENT" value="" />
    <input type="hidden" name="__VIEWSTATE" id="__VIEWSTATE" value="c9trXLZ6Rf0GbCPz07R4Z9IR2TEWBlH1wH/+KtuxBIXFvAKWIiYNWFfNMwWTLVIahbxbF3B7w1fOy2RuQUMiyuGwBCJnK8r/k833Cz+2YcyfFrUlgMHPw1Vu3Fz4NLmxmsyUNjzMOJx5kAcXR7HIN1FAUNYzkFhFjhaQ6dWbiVkwsT3Lso0mRj7rD+4BS4jqivD0NML3D5sKo+nZVhuhsC0NhKfxRdjit5Qxq5He8WGIR97bkfw2DwxwpK8hhsNsaienuwcziIhgsMLZ1wSzdJv4P7fDClaTlgZL7qE/KuyvT4mPniWT79s/ZkPiXecE9Ho47QVvTmdGpk8Zs2us4o9URMgUx9/ww1CAu3dTJi5s/iTMgBwTAhVCYn3VjQbRYhmuNv3JQe1DNvPQhBpEryLFk86dfo9k3E47W5BRs2SadPq4MRGYvmwH9ljTH0R0GxzjfySsBTt7OgQUo5TvtfrKLdLaolmPbqrrW9DACFWds+pcYwn4jIF2POQ+4zU7QfFD9hwk4OebAABn2kAmSQ==" />
    </div>

    <script type="text/javascript">
    //<![CDATA[
    var theForm = document.forms['form1'];
    if (!theForm) {
    theForm = document.form1;
    }
    function __doPostBack(eventTarget, eventArgument) {
    if (!theForm.onsubmit || (theForm.onsubmit() != false)) {
    theForm.__EVENTTARGET.value = eventTarget;
    theForm.__EVENTARGUMENT.value = eventArgument;
    theForm.submit();
    }
    }
    //]]>
    </script>


    <div>

    <input type="hidden" name="__VIEWSTATEENCRYPTED" id="__VIEWSTATEENCRYPTED" value="" />
    <input type="hidden" name="__EVENTVALIDATION" id="__EVENTVALIDATION" value="G/jUU3Li5TOwUj94ohjVvWFJ9iEX+TGnfuQvaWbOr9JzgvRhj2XYO4rNbY+Adpidau1krUhB/ktF44n+r28rIw==" />
    </div>
    <div>
    &nbsp;
    <input name="TextBox1" type="text" value="12" id="TextBox1" style="z-index: 100; left: 248px; ;
    top: 148px"
    />
    <input type="submit" name="Button2" value="Button" id="Button2" style="z-index: 101; left: 253px; ;
    top: 188px"
    />
            &nbsp;

    </div>
    <table cellspacing="0" border="0" id="FormView1" style="height:156px;width:140px;border-collapse:collapse;z-index: 102; left: 92px; ; top: 187px">
    <tr>
    <td colspan="2">
    c:
    <span id="FormView1_cLabel">nissan GTO</span><br />
    a:
    <span id="FormView1_aLabel">12</span><br />
                    <a id="FormView1_EditButton" href="javascript:__doPostBack('FormView1$EditButton','')">Edit</a>
    <a id="FormView1_DeleteButton" href="javascript:__doPostBack('FormView1$DeleteButton','')">Delete</a>
    <a id="FormView1_NewButton" href="javascript:__doPostBack('FormView1$NewButton','')">New</a>
    </td>
    </tr>
    </table>


    <table cellspacing="0" border="0" id="FormView2" style="border-collapse:collapse;z-index: 103; left: 421px; ; top: 27px">
    <tr>
    		<td colspan="2">
    c:
    <span id="FormView2_cLabel">nissan GTO</span><br />
    a:
    <span id="FormView2_aLabel">12</span><br />
    <a id="FormView2_EditButton" href="javascript:__doPostBack('FormView2$EditButton','')">Edit</a>
    <a id="FormView2_DeleteButton" href="javascript:__doPostBack('FormView2$DeleteButton','')">Delete</a>
    <a id="FormView2_NewButton" href="javascript:__doPostBack('FormView2$NewButton','')">New</a>
                </td>
    </tr>
    </table>

    </form>
    </body>
    </html>


    Wednesday, August 18, 2010 7:38 AM
  • User-469252126 posted

    compare this example with yours

    in design page ->

    goto formview1

    rightclick on  edititemtemplate--> edititem template ---->

    then right click on the aTextBox ---> properties ----> copy the id i.e ., aTextBox

    close the properties

    then delete that tool aTextBox

    now drag and drop the RadioButtonList1 to the edititemtemplate mode

    then right click on the RadioButtonList1 ---> properties ----> replace the id as aTextBox

    then right click on aTextBox ----> edit databindings.. ----> bindable properties ----> selected value ----> custom binding---->Bind("a")

    then right click on aTextBox ----> choose datasource ---->[sqldatasource1 or objectdatasource1] and select datafield to [display / value] of RadioButtonList1 should be same i.e ., a for me [because my bind("a")]

    thats its compare this with your code

    any pblm occurs make a reply/ mail me <ponmanivannangj@mobiusservices.in> <pmv.vel@gmail.com>

    "EVAN TAMILAN"Cool



    Wednesday, August 18, 2010 7:43 AM
  • User-516312066 posted

    what does this @original_id means??????

    as i am using:

    "UPDATE employee SET [Name]=@name,[Age]=@age,[NIC]=@nic,[Qualification]= @qualification,[Post]=@post,[Address]=@address,[join date]=@join_date,[Phone number]=@phno,[Attendence]=@attendence,[Licence number]=@licno WHERE  [ID] =@id"

    but it doesn't change the edited fields ......even msgbox says "record updated"

    Monday, August 10, 2015 10:58 AM