Parameters:
@{
GooglePlusParameters parameters=new GooglePlusParameters();
parameters.Count=true;
parameters.Language=GooglePlusButtonLanguages.Dutch;
parameters.ParseTags=GooglePlusButtonParseTags.Explicit;
parameters.Size=GooglePlusButtonSizes.Small;
parameters.Url = "http://stevendewaele.wordpress.com";
parameters.CallBack = "callBackMethod";
}
the url and callback is not necessary. If you build with visual studio in the development server you have to define the url because otherwise it use the localhost address.
One line of code:
@Html.GooglePlusButton(parameters)
Generate all code at that specific place
The clean way with master pages:
@section ScriptsHolder{
<script type="text/javascript">
function callBackMethod() {
alert('');
}</script>
@Html.GenerateLoadScriptButton(true)
}
@section ContentHolder{
<h2>Index</h2>
<!--Clean but in 3 parts-->
@Html.GenerateButtonTag(parameters)
<!--Quick and dirty-->
@Html.GooglePlusButton(parameters)
}
@section HeaderHolder{
@Html.GenerateScriptTag(parameters)
}
@Html.GenerateLoadScriptButton(true)
This is only necessary if you defined the parsetag parameter to explicit.