0

I was using the sample code for my project to export Html-pdf using EvoPdf converter. This is the If Else statement.

if (convertUrlRadioButton.Checked)
            {
                string url = urlTextBox.Text;
                outPdfBuffer = htmlToPdfConverter.ConvertUrl(url);
            }
            else
            {
                string htmlString = htmlStringTextBox.Text;
                string baseUrl = baseUrlTextBox.Text;
                outPdfBuffer = htmlToPdfConverter.ConvertHtml(htmlString, baseUrl);
            }

The name convertUrlRadioButton does not exists in the current context

I get this error, The name 'convertUrlRadioButton' does not exist in the current context. What am I doing wrong?

I tried to generate a field object with the name convertUrlRadioButton but

'type' does not contain a definition for 'name' and no accessible extension method 'name' accepting a first argument of type 'type' could be found (are you missing a using directive or an assembly reference?). This error occurs.

Helina
  • 1
  • 4
  • Is this from code-behind? `convertUrlRadioButton` should be a field of the class that code is from. Is it? – Fildor Mar 31 '22 at 08:59
  • There might be a typo in : `convertUrlRadioButton` - basically the compiler is telling you your using a variable name which has not been defined. As an example: `int y = 0;` but referring to it as `y1 = 4;` , `y1` in that sense is not defined. – Stefan Mar 31 '22 at 09:01
  • Stop application and right click on the button (in designer) and select properties. The first row of the property window will give you the name of the button. – jdweng Mar 31 '22 at 09:59

0 Answers0