Solved

} expected

Posted on 2004-08-22
2
745 Views
Last Modified: 2012-06-27
Compiler Error Message: CS1513: } expected

Source Error:

Line 62:              
Line 63:      
Line 64:          void addcard1 (Object Sender, EventArgs e) {              <-- in red
Line 65:          
Line 66:          public string customerid;


ASPX source

<%@ Page Language="C#" EnableViewState="false" Debug="true" %>


<script runat="server">
   
   
    public string result ="";
      
         void Page_Load(Object sender, EventArgs e) {

             // Obtain categoryId from QueryString

               string destination;
               string customerid;
               


               
            customerid = Session["customerid"].ToString();
                  
                       if (customerid != null) {
                  
                          destination="MyAccount";
                         Session["destination"] = destination;
                  
                         Response.Redirect("login.aspx");
                           }
                          
                      else {
                  
                                  int cust = Convert.ToInt32(Session["available"]);
                                  
             IBuySpy.CustomersDB1 customerprofile = new IBuySpy.CustomersDB1();

              MyList.DataSource = customerprofile.GetUsers(cust);
              MyList.DataBind();
             
              IBuySpy.OrdersDB1 orderHistory = new IBuySpy.OrdersDB1();
             
                    MyList2.DataSource = orderHistory.GetCustomerOrders(cust);
                    MyList2.DataBind();
                               }  
                  
         }
             
     
         void addcard1 (Object Sender, EventArgs e) {
         
         public string customerid;
         customerid = Convert.ToInt32(Session["customerid"]);
         IBuySpy.CustomersDB1 addcard = new IBuySpy.CustomersDB1();
         addcard.addcc(c1.Text, customerid);
         
         Response.Redirect("MyAccount.aspx");
         
              }
         }

</script>
0
Comment
Question by:dprasad
2 Comments
 
LVL 8

Accepted Solution

by:
shovavnik earned 250 total points
ID: 11867916
Does this link apply to you?

It seems the problem could be with your implementation of the IBuySpy/CustomerDB1 class.
You're probably not implementing some of the functions defined by an interface the class is supposed to implement, or something like that.
The link has a suggested resolution.

http://support.microsoft.com/default.aspx?scid=kb;EN-US;315740
0
 
LVL 4

Assisted Solution

by:chipple
chipple earned 250 total points
ID: 11868531
Here are the problems that I found at a first look.

1. You currently have one } too many at the end of your script (just before </script>).
2. You're trying to declare a public variable within your function addcard;, remove the public keyword in front of string customerid;.

Good luck!
0

Featured Post

Announcing the Most Valuable Experts of 2016

MVEs are more concerned with the satisfaction of those they help than with the considerable points they can earn. They are the types of people you feel privileged to call colleagues. Join us in honoring this amazing group of Experts.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

In an ASP.NET application, I faced some technical problems. In this article, I list them out and show the solutions that I found.  I hope it will be useful. Problem: After closing a pop-up window, the parent page should be refreshed automaticall…
User art_snob (http://www.experts-exchange.com/M_6114203.html) encountered strange behavior of Android Web browser on his Mobile Web site. It took a while to find the true cause. It happens so, that the Android Web browser (at least up to OS ver. 2.…
Microsoft Active Directory, the widely used IT infrastructure, is known for its high risk of credential theft. The best way to test your Active Directory’s vulnerabilities to pass-the-ticket, pass-the-hash, privilege escalation, and malware attacks …
This video shows how to quickly and easily add an email signature for all users on Exchange 2016. The resulting signature is applied on a server level by Exchange Online. The email signature template has been downloaded from: www.mail-signatures…

820 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question