user2977871
user2977871

Reputation: 11

Compiler Error Message: CS1513

Compilation Error

Description: An error occurred during the compilation of a resource required to service this request. Please review the following specific error details and modify your source code appropriately.

Compiler Error Message:

CS1513: } expected

Source Error:

Line 132:    protected void Button1_Click(object sender, EventArgs e)
Line 133:    {
Line 134:       string url = "gdata.youtube.com/feeds/api/videos/fhWaJi1Hsfo/comments";
Line 135:       string ReadTextFromUrl(string url) 
Line 136:       {

Upvotes: 0

Views: 415

Answers (1)

mellamokb
mellamokb

Reputation: 56769

It looks like you have one method embedded inside of another. You need to separate the methods, and then call it appropriately:

protected void Button1_Click(object sender, EventArgs e)
{
    string url = "gdata.youtube.com/feeds/api/videos/fhWaJi1Hsfo/comments";
    string result = ReadTextFromUrl(url);
}

string ReadTextFromUrl(string url) 
{
    // code here
}

Upvotes: 2

Related Questions