Updating GridView / FormView and the quirkiness of item templates
-
It all started so innocently, trying to use a form view. No matter what I did, the UPDATE would fail, generating a page dump and complaining that I needed to declare the scalar variables @whatever. My UpdateCommand was set to the standard "FieldName=@FieldName" and this worked everywhere else, so what gives? I made the foolish mistake of believing that I had free reign to format as I pleased within the ItemTemplate and EditItemTemplate sections. So, wanting to make a nice, lined up looking form, I included a table in each. And that was the problem. Add the table, get the bizarre error. Take it out and just put a <br/> between each control, and the update works. Bogus.
Christopher Duncan Author of The Career Programmer and Unite the Tribes Coming soon: Got a career question? Ask the Attack Chihuahua! www.PracticalUSA.com
-
It all started so innocently, trying to use a form view. No matter what I did, the UPDATE would fail, generating a page dump and complaining that I needed to declare the scalar variables @whatever. My UpdateCommand was set to the standard "FieldName=@FieldName" and this worked everywhere else, so what gives? I made the foolish mistake of believing that I had free reign to format as I pleased within the ItemTemplate and EditItemTemplate sections. So, wanting to make a nice, lined up looking form, I included a table in each. And that was the problem. Add the table, get the bizarre error. Take it out and just put a <br/> between each control, and the update works. Bogus.
Christopher Duncan Author of The Career Programmer and Unite the Tribes Coming soon: Got a career question? Ask the Attack Chihuahua! www.PracticalUSA.com
Christopher Duncan wrote:
<br/>
I take it you are not talking about MFC :rolleyes:
We are a big screwed up dysfunctional psychotic happy family - some more screwed up, others more happy, but everybody's psychotic joint venture definition of CP
blog: TDD - the Aha! | Linkify!| FoldWithUs! | sighist -
Christopher Duncan wrote:
<br/>
I take it you are not talking about MFC :rolleyes:
We are a big screwed up dysfunctional psychotic happy family - some more screwed up, others more happy, but everybody's psychotic joint venture definition of CP
blog: TDD - the Aha! | Linkify!| FoldWithUs! | sighistWell, when I discovered what was going on, at least two of those initials could well represent my instinctive outburst. I'd elaborate, but my kid sister just walked in... :)
Christopher Duncan Author of The Career Programmer and Unite the Tribes Coming soon: Got a career question? Ask the Attack Chihuahua! www.PracticalUSA.com
-
Christopher Duncan wrote:
<br/>
I take it you are not talking about MFC :rolleyes:
We are a big screwed up dysfunctional psychotic happy family - some more screwed up, others more happy, but everybody's psychotic joint venture definition of CP
blog: TDD - the Aha! | Linkify!| FoldWithUs! | sighistAs it turns out, you can use standard html tables just fine, as long as it's not aspx stuff. I used the table / tr / td tags and got what I wanted. Serves me right for defaulting to the Microsoft way of doing things... :rolleyes:
Christopher Duncan Author of The Career Programmer and Unite the Tribes Coming soon: Got a career question? Ask the Attack Chihuahua! www.PracticalUSA.com
-
It all started so innocently, trying to use a form view. No matter what I did, the UPDATE would fail, generating a page dump and complaining that I needed to declare the scalar variables @whatever. My UpdateCommand was set to the standard "FieldName=@FieldName" and this worked everywhere else, so what gives? I made the foolish mistake of believing that I had free reign to format as I pleased within the ItemTemplate and EditItemTemplate sections. So, wanting to make a nice, lined up looking form, I included a table in each. And that was the problem. Add the table, get the bizarre error. Take it out and just put a <br/> between each control, and the update works. Bogus.
Christopher Duncan Author of The Career Programmer and Unite the Tribes Coming soon: Got a career question? Ask the Attack Chihuahua! www.PracticalUSA.com
OK - I don't know why this was 1 voted. I'll 5 it to raise it up - oops perhaps GridViewGuy did the driveby.
Deja View - the feeling that you've seen this post before.