I'm a newbie to aspx programming. I'm facing the problem where the data I fetch contain null value. my code :
<asp:TemplateField HeaderText="NCRE" ItemStyle-Width="150px" >
<ItemTemplate>
<asp:Hyperlink ID="Hyperlink1" runat="server" Text='<%# Eval("formid") %>' NavigateUrl='<%# Eval("formid","~/sapphire/ncrr" + Mid(Eval("formid"), 4, 1) + ".aspx?formid={0}") %>' />
</ItemTemplate>
</asp:TemplateField>
And my code behind:
Protected Function geturl(value As Object) As String
Dim NCRE As String = Convert.ToString("formid")
If Mid(NCRE, 4, 1) = 2 Then
Return ("~/sapphire/ncrr2.aspx")
Else
Return ("~/sapphire/ncrr1.aspx")
End If
End Function