Parser Error on run newly added webpage - c#

I have add a new webpage in solution.
when I try to run, it shows an Error like below.
Thanks in advance..

The Inherits attribute value is the name of the class which inherits Page in the backend.
Also the path has to be correct. So go on and make some changes.

Related

ASPX could not load type

When I start my ASP.NET project one of the modules doesn't load. I've tried reloading it and rebuilding the project but it hasn't made any difference. How can I get this to load?
The UI displays a parse error:
The code behind file Error.aspx.cs must contains the class names CMSMessage_Error - but its not find it.
Double check the Name of the class and that this file exist.
Changing CodeBehind to CodeFile resolved this for me.

Parser Error Could not load type 'testconnect.index'

I have encountered an error that prevents me from uploading the webpage to the server. I managed to let it work without any errors when I am running visual studio.
Here's the error
However, when I removed Inherits="testconnect.index" , it can work but it cannot connect index.aspx.cs to index.aspx.
Like for example:
With lbl_test.Text inside the index.aspx
Does anyone knows how to fix the error?
You're trying to inherit from testconnect.index, but your class is named index1. Can you change the class name to index? Or, conversely, set the Inherits directive to inherit from testconnect.index1?
You have to specify the exact name of the class in order to reference it. "Close enough" isn't close enough.
(Note also that Visual Studio is trying to tell you in your index1 class that lbl_test doesn't exist. Supposedly perhaps the designer partial class is index? If that's the case, you'll probably want to just rename this partial class to index as well.)
Okay I have got it working by changing CodeBehind="index.master.cs" to CodeFile="index.master.cs". I learned that you will have to compile the file first if you want to use CodeBehind. Other than that, it is recommended not to name the aspx page exactly similar to masterpage.

Creating a custom pop up for Umbraco back office

[Final EDIT] Here is a link to the code I wrote in case it helps anyone.
I think I have a solution. Umbraco uses asp.net files for their popups
which is something I haven't used yet but I think I can get the hang
of it. I don't know how to access the aspx from within my class,
should I make a code behind partial class?
Thanks for any help.
I am developing a multi-lingual site, using Umbraco, where content nodes are automatically copied to each language as they are created. Is there any way to implement a custom popup to confirm that it should be copied to all instead?
This wouldn't actually be on the site, rather in the back office.
Or is it possible to open a browser popup with c# as all I really need is a bool value from a message box?
[EDIT: added possible solution]
I sorted this by adapting Umbraco's own create function. I made a new .aspx file and added the functionality that I needed to the code behind.
I was able to add a context menu item that allowed me to call my new page and from there called a method to duplicate the content.
From the method, I pass the new node and get the parent id. Then I compare all the node names for those that match and use the umbraco document.copy() method to recreate the content under each language at the correct position.
If I can make the code more generic then I will upload it as a package to Umbraco.

A random call for a style.css action, which doesn't exist - Why?

My error logger has logged an error recently that just boggles me.
Here's a copy'n paste of the error:
A public action method 'style.css'
could not be found on controller
'ProductController'.
So I ran a search over the entire solution for references to style.css. There are none, and I have no stylesheet named style.css.
The calls are happening on a legitimate users logged in session even. W.T.H?
It seems to me that there's a route mapped in a way that's "catching" '/style.css'.
Used Firebug to find the call... it was coming from a jQuery plugin. Resolved by setting the stylesheet name in the plugin options.
Thanks everyone!

Displaying Error Message from C# AfterInstall Event

Can someone please tell me how to display error message in C# during execution of AfterInstallEvent?
My project uses the Microsoft set-up and deployment project and then I have created a class that is called when the AfterInstall event is fired.
MessageBox.Show(); doesn't work..."The name 'MessageBox' does not appear in the current context".
If it was that simple, I wouldn't be asking!?
The real solution is to use scope. Something like this:
global::System.Windows.Forms.MessageBox.Show(ex,"Error",MessageBoxButtons.OK, MessageBoxIcon.Error);
Cheers
This is very old but I'll answer anyway:
It's just a missing reference.
Add a reference to System.Windows.Forms to the project containing the class.
Also add "using System.Windows.Forms;" to the top of your class file.
As far as I know there shouldn't be any issues with displaying message boxes from a custom install action.

Categories