Quantcast
Channel: Visual Studio and Visual Web Developer Express
Viewing all articles
Browse latest Browse all 3509

renderPartial / viewDataDictionary

$
0
0

I am re-writing a website in VS 2017 that was originally written in VS 2010.
The command I used originally to display my visitor count in the footer was:-
@Html.RenderPartial( "/Counter/Counter.ascx", new ViewDataDictionary {{ "digits", 6 }, { "id", "Count" }}).
This displayed the number in Count.txt as 6 digits using digits.gif as the pattern.
When I try and use the same code in VS 2017, I get the following error message:
'ViewDataDictionary' does not contain a constructor that takes 0 arguments.
I have spent a lot of time looking at similar questions on various forums and have been unable to find an answer.
Any help you can give me will be most appreciated.


Viewing all articles
Browse latest Browse all 3509

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>