I have a class where I have saved a configuration key being key and value, however I need to get the value of that key and pass it to my cshtml
page. I'm having trouble with this.
I've already passed the class path, but I can not reference to bring up the key value. I need to bring and value the key to be able to make a simple logic over that value.
I have a configuration class of keys that are saved: (key is ReportServer)
public static string ReportServer
{
get { return InstanceResolverFor<IConfigurationSource>.Instance.Read("ReportServer"); }
}
I have my page cshtml
where it has this razor syntax:
@section scripts{
@Scripts.Render("~/Content/js/app/FIDC/index.js")
@if (Model != null)
{
if (Model.Erro)
{
<script>
modal.exibir("Ops", "@Model.MensagemErro", modal.tipoModal.Erro);
</script>
}
else
{
<script>
modal.exibir("Ok", "@Model.MensagemSucesso", modal.tipoModal.Sucesso);
</script>
}
}
}
I have My business class: (I am getting the value of my key through config.ReportServer
)
var serverReport = reportViewer.ServerReport;
serverReport.ReportServerUrl = new Uri("http://CCD-APPBI-001:80/ReportServer");
serverReport.ReportPath = string.Concat("/", config.ReportServer, "/",relatorio);
Now I need to get the value of this key ReportServer
to my html, where I have two tags below:
<a target="_blank" href="http://ccd-appbi-001/Reports/Pages/Report.aspx?ItemPath=%2fRelatoriosClientes%2fcessao_polo&SelectedSubTabId=GenericPropertiesTab&SelectedTabId=ViewTab;rs:Command=Render">Abrir</a>
<a target="_blank" href="http://ccd-appbi-001/Reports/Pages/Report.aspx?ItemPath=%2fRelatoriosClientes%2fsabemi&SelectedSubTabId=ReportDataSourcePropertiesTab&SelectedTabId=ViewTab">Abrir</a>
If anyone can help, thank you.