Want to become a Vibe Coder? Join Vibe Coding Training here
x
C# Corner
Tech
News
Videos
Forums
Jobs
Books
Events
More
Interviews
Live
Learn
Training
Career
Members
Blogs
Challenges
Certification
Contribute
Article
Blog
Video
Ebook
Interview Question
.NET
.NET Assemblies
.NET Core
.NET Standard
Active Directory
ADO.NET
Agile Development
AJAX
Alexa Skills
Algorithms in C#
Android
Angular
Architecture
ArcObject
Artificial Intelligence
ASP.NET
ASP.NET Core
Augmented Reality
Aurelia
AWS
Azure
Backbonejs
Big Data
BizTalk Server
Blockchain
Bootstrap
Bot Framework
Business
C#
C# Corner
C, C++, MFC
Career Advice
Chapters
CIO
Cloud
COBOL.NET
Coding Best Practices
Cognitive Services
COM Interop
Compact Framework
Cortana Development
Cryptocurrency
Cryptography
Crystal Reports
Current Affairs
Custom Controls
Cyber Security
Data Mining
Databases & DBA
Design Patterns & Practices
DevOps
DirectX
Dynamics CRM
Enterprise Development
Entity Framework
Error Zone
Exception Handling
Expression Studio
F#
Files, Directory, IO
Games Programming
GDI+
General
Generative Engine Optimization (GEO)
Google Cloud
Google Development
Graphics Design
Hardware
Hiring and Recruitment
HoloLens
How do I
HTML 5
Internet & Web
Internet of Things
Ionic
iOS
Java
Java and .NET
JavaScript
JQuery
JSON
JSP
Knockout
kotlin
Leadership
Learn .NET
LightSwitch
LINQ
Machine Learning
Microsoft 365
Microsoft Office
Microsoft Phone
Mobile Development
Multithreading
Nano Banana
NetBeans
Networking
Node.js
Office Development
OOP/OOD
Open Source
Operating Systems
Oracle
Outsourcing
Philosophy
PHP
Power BI
Printing in C#
Products
Progressive Web Apps
Project Management
Python
Q#
QlikView
R
React
Reports using C#
Robotics & Hardware
Ruby on Rails
Salesforce
Security
Servers
SharePoint
SignalR
Silverlight
Smart Devices
Software Testing
SQL Language
SQL Server
Startups
String in C#
Swift
TypeScript
Unity
UWP
Visual Basic .NET
Visual Studio
WCF
Wearables
Web Development
Web Services
Web3
Windows 10
Windows Controls
Windows Forms
Windows PowerShell
Windows Services
Workflow Foundation
WPF
Xamarin
XAML Standard
XML
XNA
XSharp
Register
Login
3
Answers
beginner woes
cdog
18y
2.2k
0
1
Active Directory
Reply
This is probably an easy fix but I can not for the life of me find what is causing this error. I am translating a monster
vb
.net to c# script and this is the latest error:
Compiler Error Message: CS1513: } expected
Source Error:
Line 91: }
Line 92:
Line 93: void SaveComps() {
Line 94: private string Result;
Line 95: private string Source;
Here is my code:
using System;
using System.Data;
using System.Configuration;
using System.Collections;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using System.Web.UI.HtmlControls;
public partial class BPOCompSalesListings : System.Web.UI.Page
{
private string bpo;
private string strRequestID;
private string ProductCode;
private void Page_Load(object sender, System.EventArgs e) {
Helper.checkSession(Session, Page);
if (!(Request.QueryString["PRODUCT"] == null)) {
ProductCode = Request.QueryString["PRODUCT"];
}
strRequestID = Request.QueryString["RequestID"];
ClientScript.RegisterClientScriptInclude("autosave", "scripts\\autosave.js");
ClientScript.RegisterStartupScript(this.GetType(), "myAutoSave", "AutoSaveInit(600000);", true);
string script = "function SubmitFormToBeSaved() { " + ClientScript.GetPostBackEventReference(btnSubmit, "") + "; } ";
ClientScript.RegisterClientScriptBlock(this.GetType(), "autosave", script, true);
if (!Page.IsPostBack) {
if (!(strRequestID == null)) {
if (loadBPO(true)) {
// ensure we have fresh data
loadControls();
}
}
// Make sure the brokerinfo matches the current lmc working on the assignment
// Helper.setBrokerInfo(Request.QueryString("RequestID"))
// ClientScript.RegisterStartupScript(Me.GetType(), "
popup
", "
javascript
:window.showmodaldialog('ValidateBPO.aspx', '', ''", True)
// ClientScript.RegisterStartupScript(Me.GetType(), "popup", "ShowPopup('ValidateBPO.aspx')", True)
btnOk.Visible = false;
PanelExtraValidation.Visible = false;
ButtonComment.Attributes.Add("onclick", "javascript:alert(\'Submitting form for approval.\');");
}
}
private bool loadBPO(bool refreshBPO) {
// force new bpo if none exists or we just saved data
// If Session("bpo") Is Nothing Or refreshBPO Then
try {
bpo = (Request.QueryString["RequestID"]);
}
catch (Exception ex) {
Session["exceptionMessage"] = ex.Message;
DisplayError("LoadBPO\\", (ex.Source + (" " + ex.Message)));
return false;
}
// Session("bpo") = bpo
// Else
// bpo = Session("bpo")
// If Not bpo.BPOID = Request.QueryString("RequestID") Then
// Try
// bpo = New bpoInfo(Request.QueryString("RequestID"))
// Catch ex As Exception
// Session("exceptionMessage") = ex.Source + " " + ex.Message
// DisplayError("LoadBPO\", ex.Source + " " + ex.Message)
// Return False
// End Try
// Session("bpo") = bpo
// End If
// End If
return true;
}
private void loadControls() {
// we load/unload screen by visual grouping/order
LoadPropertyInfo();
LoadPropertyCharacteristics();
LoadComps();
}
void LoadComps() {
LoadSale1();
LoadSale2();
LoadSale3();
LoadList1();
LoadList2();
LoadList3();
}
void SaveComps() {
private string Result;
private string Source;
if (!SaveSale1(Result)) {
Source = "Save Sale 1: ";
DisplayError(Source, Result);
}
// sale 1
if (!SaveSale2(Result)) {
Source = "Save Sale 2: ";
DisplayError(Source, Result);
}
// sale 2
if (!SaveSale3(Result)) {
Source = "Save Sale 3: ";
DisplayError(Source, Result);
}
// sale 3
if (!SaveList1(Result)) {
Source = "Save List 1: ";
DisplayError(Source, Result);
}
// list 1
if (!SaveList2(Result)) {
Source = "Save List 2: ";
DisplayError(Source, Result);
}
// list 2
if (!SaveList3(Result)) {
Source = "Save List 3: ";
DisplayError(Source, Result);
}
// list 3
}
}
I can not seem to find the cause, any help would be appreciated
Post
Reset
Cancel
Answers (
3
)
Related Discussion