Having problems with your account or logging in?
A lot of changes are happening in the community right now. Some may affect you. READ MORE HERE
Highlighted
Shirley2 Trusted Contributor.
Trusted Contributor.
391 views

Web Application

Where and how do I define 'Response.Redirect' in my web application?

I get a COBCH0301 Unrecognized verb error.

Thanks

Shirley

0 Likes
3 Replies
Micro Focus Expert
Micro Focus Expert

RE: Web Application

Hi Shirley,

The following works for me when coded within a Web Form:

 

      $set ilusing"System.Web"
      $set ilusing"System.Web.UI"
      $set ilusing"System.Web.UI.WebControls"
       class-id testasp._Default is partial
               inherits type System.Web.UI.Page public.
       working-storage section.
      
       method-id Page_Load protected.
       local-storage section.
       procedure division using by value sender as object by value e as type EventArgs.
       
           goback.           
       end method.
              
       method-id Button1_Click protected.
       procedure division using by value sender as object e as type System.EventArgs.
         
           invoke Response::Redirect("About.aspx")

       end method.

       end class.
0 Likes
Shirley2 Trusted Contributor.
Trusted Contributor.

RE: Web Application

Hi Chris

It wouldn't allow me to use '$set ilusing' or just '$set using' but changing the syntax of the Response.Direct to
invoke Response::Redirect did the trick.

Thank you so much

Shirley
0 Likes
Micro Focus Expert
Micro Focus Expert

RE: Web Application

If you're getting an error on a $set ilusing directive, it's probably in the wrong column. Consult the product documentation, or just make sure the $ character is in column 7. Also make sure all $set ilusing directives appear before any code in the source file; it's an initial directive (again, as described in the product documentation).

Namespaces can also be specified in the project properties.

0 Likes
The opinions expressed above are the personal opinions of the authors, not of Micro Focus. By using this site, you accept the Terms of Use and Rules of Participation. Certain versions of content ("Material") accessible here may contain branding from Hewlett-Packard Company (now HP Inc.) and Hewlett Packard Enterprise Company. As of September 1, 2017, the Material is now offered by Micro Focus, a separately owned and operated company. Any reference to the HP and Hewlett Packard Enterprise/HPE marks is historical in nature, and the HP and Hewlett Packard Enterprise/HPE marks are the property of their respective owners.