0

I am using MVC4 , and in Razor engine I have a strongly typed view. I do have a lot of validation , but I figured that I could simply have a link open a newly spawned browser page, but this is not happening.

What could I be doing wrong?

<a target="_blank" href="http://fedgov.dnb.com/webform/displayHomePage.do">@Html.LabelFor(m=>m.duns)</a>

Edit:

Showing View Source code

<form action="/Account/Register" method="post"><input name="__RequestVerificationToken" type="hidden" value="OeF9GVP__M0yxnCeShixsKBiT1OegJ3kS5BogaRW-rhSEGXkdMujjERy3dkIvf48UzllvLfi9bVFxGIljgq4ymi_uhZa1KlQX8yV2X3lazM1" />    <div class="box-content nopadding">



 <tr>
                        <td class="width30">
                            <a target="_new" href="http://fedgov.dnb.com/webform/displayHomePage.do"><label for="duns">DUNS #:</label></a>
                            <span class="tooltip-top helper" title="Click on labels to learn more about DUNS, CAGE, SIC and NAICS"><i class="icon-info-sign"></i></span>                
                        </td>

enter image description here

Clicking on the Link "DUNS" jumps to highlighting the validation required textbox, but doesn't display the numbers required text etc... Seems a bit odd.

tereško
  • 58,060
  • 25
  • 98
  • 150

2 Answers2

0

Try this code, I think this might helps you

<a href="http://fedgov.dnb.com/webform/displayHomePage.do" target="_blank">@Html.Raw(Html.LabelFor(m=>m.duns))</a>
Ajay
  • 6,418
  • 18
  • 79
  • 130
0

Maybe its caused by the label?

This (your original snippet) doesnt work for me...

<a target="_new" href="http://fedgov.dnb.com/webform/displayHomePage.do"><label for="duns">DUNS #:</label></a>  

But this does...

<a target="_new" href="http://fedgov.dnb.com/webform/displayHomePage.do">DUNS #:</a> 

EDIT: this also works for me...

<label for="duns"><a target="_new" href="http://fedgov.dnb.com/webform/displayHomePage.do">DUNS #:</a></label>