question

RodFalanga avatar image
0 Votes"
RodFalanga asked RodFalanga commented

Why is the class aspNetHidden still in my MVC project?

I have a website which I started several years ago, using ASP.NET WebForms. (I've written a LOT of WebForms apps.) But I want to move with the times, so whenever Microsoft comes out with a new version of the .NET framework, I upgrade this app. And I started it over, or at least I thought I started it over, as a MVC app using .NET 5.

Tonight, I thought I'd put in more time on the app. I brought it up in MS Edge and then did a Ctrl-U to see the rendered HTML. Imagine my surprise when I saw this code snippet:

 <div class="aspNetHidden">
    <input type="hidden" name="__EVENTTARGET" id="__EVENTTARGET" value="" />
    <input type="hidden" name="__EVENTARGUMENT" id="__EVENTARGUMENT" value="" />
    <input type="hidden" name="__VIEWSTATE" id="__VIEWSTATE" value="X5CQRISbVwqII6d5rmef3I1kiZnEOSmg3rnRtLX6AVWuumec8snDhna+GND6DYejWI9ksQQK8xNJXoaISHmtgfsfDN8B7zfbey+/cIXZvxE=" />
 </div>

That is the old ViewState from WebForms. I've seen that rendered on a bazillion WebForms pages I wrote. Have I done something wrong when I tried to update my website?



dotnet-aspnet-core-mvc
· 2
5 |1600 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.

Hi,@RodFalanga,

Can you show the view code of the page in your project?

1 Vote 1 ·

Hi @YiyiYou-MSFT, I believe I've found the problem. I am embarrassed to admit that I have not yet published the changes I've made to the website to the hosting company. I am very embarrassed. Sorry to bother everyone.


I'm working now on developing an Azure Pipeline to publish it to the hosting company, upon successfully building it.

0 Votes 0 ·

0 Answers