asp.net - Retrieving data and displaying it properly -
i have question regarding retrieving data website.
my default.aspx this:
<html xmlns="http://www.w3.org/1999/xhtml"> <head runat="server"> <title>untitled page</title> </head> <body> <form id="form1" runat="server"> <div> <asp:textbox runat="server" id="txtinput"></asp:textbox><br /><br /> <asp:button runat="server" id="btnsubmit" text="submit" onclick="btnsubmit_click" /><br /><br /> <asp:label runat="server" id="lblresult1" text=""></asp:label> </div> </form> </body> </html> and code behind this:
using system; using system.configuration; using system.data; using system.linq; using system.web; using system.web.security; using system.web.ui; using system.web.ui.htmlcontrols; using system.web.ui.webcontrols; using system.web.ui.webcontrols.webparts; using system.xml.linq; public partial class _default : system.web.ui.page { protected void page_load(object sender, eventargs e) { } protected void btnsubmit_click(object sender, eventargs e) { system.net.webclient wc = new system.net.webclient(); lblresult1.text = wc.downloadstring(string.format("http://foo.com/servlet/accessmodule?id={0}&doc_type1=xyz&response=k", txtinput.text)); } } it read data url above , display on page.
for example if enter 12345678 in textbox.
the result this:

now making last part of result clickable. (http://foo.com/report/svc/id=000001df-d80ab26f-c7d2-4fc3-add6-361e6630d572)
any ideas?
add < > tag string.format
label s = new label(); s.text = wc.downloadstring(string.format("http://foo.com/servlet/accessmodule?id={0}&doc_type1=xyz&response=k", txtinput.text)); lblresult1.text =string.format("<a href='{0}'></a>", s.text));
Comments
Post a Comment