Last post Mar 05, 2009 09:12 AM by Ace406
Mar 04, 2009 06:29 PM|Ace406|LINK
I have a gridview that pulls a record from the DB that you can update. Once the record is found and updated when the user clicks the update button I have a script that should look at the old values of the record and stop the update if the "if" statement
is met. My problem is that I keep getting the CS1002: ; expected error message when browsing to the page.
Here is the code:
<script type="text/vbscript" runat="server">
Protected Sub CheckBeforeUpdate_RowUpdating(ByVal sender As Object, ByVal e As GridViewUpdateEventArgs)
If e.OldValues("fieldname") = "fieldvalue" Then
Response.Write("Sorry, you cannot update this record")
e.Cancel = True
And when calling it from the GridView here is what I have:
Any help will be greatly appreciated!
Mar 05, 2009 08:22 AM|klpatil|LINK
your <script type should be type="text/VB" instead of type="text/vbscript".
Give a try and let me know if you need any help
Mar 05, 2009 09:12 AM|Ace406|LINK
I have tried this change and I am still getting the same error message.
Any suggestions on what to try next?