create hyperlink in gridview asp.net c# -
my code in c# asp.net 3.5
in following code "msg" has many words spaces , characters (eg:failed prepare sync favorites : directory not exist: \stl-fnp-02\ryounes$\sync\favorites). "msg" pulled database gridview. not able create hyperlink "msg" in gridview. since has spaces not creating hyperlink.
i need create hyperlink "msg" , latter use in linq query.
i think 1 shud either use eval or url encoder. not sure how it. can how go it?
<asp:hyperlinkfield datatextfield="msg" headertext="msg" datanavigateurlfields="msg" datanavigateurlformatstring="sync.aspx?msg={0}" />
the easiest way around use
<asp:templatefield headertext="msg"> <asp:hyperlink runat="server" text='<%# httputility.urlencode(eval("msg")) %>' navigateurl='<%#eval("msg")%>' /> </asp:templatefield>
not 100% syntax correct general idea
Comments
Post a Comment