I have created a custom button to appear like so.
What I wish to do is "Onclick" I wish the values in field RLPART to be changed to "*EMPTY* " and field RLQTY to be changed to "0".
SQL Connector is as follows. Probably unnecessary but I thought I would add it to give all info posssible.
ConnectionString="<%$ ConnectionStrings:RightFirstTimeConnectionString2 %>"
DeleteCommand="DELETE FROM [factRepairLocation] WHERE [RLID] = @original_RLID AND (([RLPart] = @original_RLPart) OR ([RLPart] IS NULL AND @original_RLPart IS NULL)) AND (([RLQty] = @original_RLQty) OR ([RLQty] IS NULL AND @original_RLQty IS NULL)) AND (([RLStatus] = @original_RLStatus) OR ([RLStatus] IS NULL AND @original_RLStatus IS NULL))"
InsertCommand="INSERT INTO [factRepairLocation] ([RLID], [RLPart], [RLQty], [RLStatus]) VALUES (@RLID, @RLPart, @RLQty, @RLStatus)"
OldValuesParameterFormatString="original_{0}"
SelectCommand="SELECT [RLID], [RLPart], [RLQty], [RLStatus] FROM [factRepairLocation]"
UpdateCommand="UPDATE [factRepairLocation] SET [RLPart] = @RLPart, [RLQty] = @RLQty, [RLStatus] = @RLStatus WHERE [RLID] = @original_RLID AND (([RLPart] = @original_RLPart) OR ([RLPart] IS NULL AND @original_RLPart IS NULL)) AND (([RLQty] = @original_RLQty) OR ([RLQty] IS NULL AND @original_RLQty IS NULL)) AND (([RLStatus] = @original_RLStatus) OR ([RLStatus] IS NULL AND @original_RLStatus IS NULL))">
I won't bore you guys with what I have already tried as obviously it failed. I hope you guys (well, I am actually sure) that you can help me.
All the best
Chris
Chris JohnsonPosted Aug 19, 2011, 5:57 AM
ConnectionString="<%$ ConnectionStrings:RightFirstTimeConnectionString2 %>"
UpdateCommand="UPDATE [factRepairLocation] SET [RLPart] = '*EMPTY*', [RLQty] = '0', [RLStatus] = '*EMPTY*' WHERE [RLID] = @original_RLID AND (([RLPart] = @original_RLPart) OR ([RLPart] IS NULL AND @original_RLPart IS NULL)) AND (([RLQty] = @original_RLQty) OR ([RLQty] IS NULL AND @original_RLQty IS NULL)) AND (([RLStatus] = @original_RLStatus) OR ([RLStatus] IS NULL AND @original_RLStatus IS NULL))">
Now if somehow I can combine the Edit and Update buttons to ONE button that runs bothe the edit and update commands would be job done!!
Chris JohnsonPosted Aug 19, 2011, 4:16 AM
Unfortunately System.Web.UI.WebControls.ButtonField' does not have a public property named 'OnClientClick' So I think I may need a little more help.
Suthish NairPosted Aug 18, 2011, 1:04 PM