Ajax NumericUpDownExtender error - asp.net

I am getting this error when trying to use the numericupdown control:
Assembly 'AjaxControlToolkit, Version=3.0.30512.20315,
Culture=neutral, PublicKeyToken=28f01b0e84b6d53e' contains a Web
resource with name
'AjaxControlToolkit.NumericUpDown.NumericUpDownBehavior.debug.js', but
does not contain an embedded resource with name
'AjaxControlToolkit.NumericUpDown.NumericUpDownBehavior.debug.js'.
I have researched this and have found that this problem arises because the source code for the AJAXToolkit calls the file 'NumericUpDownBehavior.debug..js'. The only solution I have seen is this one:
Download the ajax control toolkit with the source code. Go to the folder
"AjaxControlToolkit\NumericUpDown\" and there's a file there named
"NumericUpDownBehavior.debug..js". Rename it to "NumericUpDownBehavior.debug.js".
After this open the "AjaxControlToolkt" project in Visual studio and choose "Show All
Files" in Solution Explorer". Exclude from the project the file with
the double dots (.debug..js) and include the correct one. Right click
on the .js file and choose "Properties". From there Choose the Build
Action "Embedded Resource". Compile it and add the resulting dll to to
your projects where you are using ajax (Replace the dll's).
I have tried this but I must have done it wrong because it did not work. Can anyone provide a more detailed solution to this problem?
Thanks!

Related

Debug aspx / cs scripts with no VS2017 project

Someone's handed me a crashing aspx / .cs script to debug.
Any idea how to set up a VS2017 project to debug it?
I've tried using the wizard, Visual C#, asp.net
This works OK for one set of pages on the site, Default.aspx and Default.aspc.cs
When I add the page I want to debug I get loads of compilation errors in the cs file, referring to objects in the aspx
The name 'Chart1' does not exist in the current context
and one reference I can't see how to sort out
Error CS0012 The type 'Package' is defined in an assembly that is not referenced. You must add a reference to assembly 'WindowsBase, Version=4.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35'.
Am I going about this the right way?
VS2017 - File -> Open -> Website
browse to your local source folder and press OK
Right click on the aspx you want to debug. Choose 'Set As Start Page'
Now run the project.

Can't find code behind files in Sitecore File Explorer

When I view an ascx file from Sitecore File Manager and it displays something like CodeBehind="Promo Downloads.ascx.cs in the header, but It doesn't seem to exist. There is an asp:Literal control I'm trying to figure out where it's coming from.
.cs files are compiled into a dll and will/shouldn't be available in the Sitecore solution using the code behind model. This only happens if you use the old code file model.
If you want to see the code for this then you'll need to view the original source code or decompile the dll.
To decompile the URL: The dll will be in the /bin folder. To find out which dll, look at the namespace in the .ascx file - the name of the dll should be the first part of the namespace.
Once you've found the dll, use dotpeek https://www.jetbrains.com/decompiler/ to examine the code.

Does visual studio includes only aspx.cs files in dll which are having same namespace of project?

I am using visual studio 2012. I have created a directory named "Handler" inside my project and added an aspx file along with .cs file (both downloaded from a third party tool) to it. All code is working fine.
Now, I have published project to another directory. In published directory I have marked that the in side "Handler" folder aspx page is there but not the .cs page.
Now, when ever I am requesting the aspx page inside "Handler", I am getting error 404 xxxx.aspx page not found. Now, if I am coping the path and hit the url for that page then I am getting error that xxxx.aspx.cs file not found.
As per my best knowledge, whenever we build the project, all the code will build to dll in bin folder. Then why this file is required .cs file?
Thanks.
This will depend on the attributes of the #Page directive of your aspx page
I guess your third party page #page directive holds a CodeFile attribute.
CodeFile attribute states that, even though the .aspx.cs gets compiled (let's say it just gets checked) in Visual Studio, the result of the compilation will not be put in the dll resulting of the build.
The .aspx.cs will be compiled, along with the .aspx upon first invocation.
This allows to edit your deployed aspx.cs and have the result available immediately (which can be seen as handy, or risky)
As per my best knowledge, whenever we build the project, all the code
will build to dll in bin folder. Then why this file is required .cs
file?
This is the case when being in the default case, having a CodeBehind attribute in the page directive,instead of a CodeFile attribute
See CodeBehind and CodeFile attributes in documentation for #Page element
Note that you can use CodeFile attribute in Web Application Projects. I do it all the time.

Publish only edited page in asp.net

Whenever I update a small part of my website I have to upload whole website again.
If i upload only edited part it throw me exception.
The way I upload my website:
For example if I have 4 pages (home, register, about me, contact me) and if I update home.aspx, I publish whole website in a local address, and then I compress it with zip format and upload it manually.
Is it possible to publish only updated part?
It is not possible to publish only a part of website, but what you can do is to choose Single-File Assembly build option ,by this you can get single assembly for your page.so intead of updating whole application you can update only the pages you change
read more
What I always do when publish ASP.Net Webform project, I complate it with two steps. Maybe this way suitable for you.
When you use publishing tool on visual studio by selecting Build menu -> Publish, you can choose "File System" as "Publish Method", type your "Target Location", and select "Replace matching files with local copies". It mean the project will publish modified files only.
After publishing have done, Open defined "Target Location" using windows explore and sort by "Modified Date" and just copy newer modified files for each directory recursively to your server.
If you build the website pages into dll. You can not published only the aspx. there are many other dll and compiled files in bin folder, we don't know which matches which aspx.
If you only edited the "view", i mean, the html and markup part of <%%> code, and no code behind (.aspx.cs) change, you can published only this aspx. But remember to set website as updatable in the publish dialog.
I suggest you to compile the aspx into one dll. according to #Buzz 's answer. Then, your aspx files would be only an empty file. All you need to do is upload only one dll to the bin folder.

ASP.NET website still looking for old name of renamed referenced assembly

I have a solution with a website and a class library. I have renamed the class library project from Insight_WebControls to Insight.WebControls. I have also renamed the assembly it produces in its properties.
I have removed from the website's references the old class library and added the new.
However, when I try to build the website, I get the error 'Could not load file or assembly 'Insight_WebControls' or one of its dependencies. The system cannot find the file specified.' There is a dll called 'Insight.WebControls' in the bin folder.
Clearly some part of the website is still looking for the old filename. Can anyone tell me how to point it to Insight.WebControls.dll instead?
Thanks
David
Just as a couple of shots in the dark:
Have you looked inside the web.config to see if there is any reference to the old file name in there?
If that turns up a blank then try opening up the project file for the web site and do a similar search.

Resources