本文介绍了隐藏最终用户的链接的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我有一个网页,其中有用于下载单词documnet的选项. 我做了什么,我从c#创建了一个标签,并将其href链接设置为类似于wordow的word文档:
i have a web page in which there is the options for downloading word documnet. what i did , i create one tag from c# and set its href link to word document like bellow:
StringBuilder sb = new StringBuilder(); sb.Append("<a");> sb.Append("href=''"); sb.Append("www.mydomainName/doc1.doc'' >"); sb.Append(""); Label l = new Label(); l.Text = sb.ToString(); form1.Controls.Add(l);因此一旦页面将呈现,最终用户如果看到了源页面,那么他/她将能够查看该Word文档链接,但是我不希望任何最终用户看到我的链接 您能告诉我我该怎么做吗?
so once page will render and end user if saw source page then he/she would be able to view that word document link but i dont want any end user to see my link can u tell me how i can do this
推荐答案这根本没有道理.如果您不希望他们看到链接,请不要渲染它.还有什么其他选择? 另外,您这样做的方式很疯狂.为什么要随机添加标签并用HTML填充标签?为什么不将文字放在表格的正确位置并填充它,甚至是超链接? This makes no sense at all. If you don''t want them to see a link, don''t render it. What other option is there ? Also, your way of doing this is nuts. Why would you add a Label at random and fill it with HTML ? Why not put a literal in the right place on the form and populate that, or even a hyperlink ?
我必须同意Christian的观点-您在做什么并没有多大意义. 您想达到什么目的,您认为这会有所帮助? I have to agree with Christian - what you are doing does not make a lot of sense. What are you trying to achieve, that you think this will help?
我想您的意思是您不希望URL显示在地址栏中,对吗? 如果是这样,则有几种方法. 此方法执行urlrewrite ... I think you mean that you do not want the URL showing in the address bar, is that right? If so there are several methods. This method does an urlrewrite... <system.web> <urlMappings enabled="true"> <add url="~/home.aspx" mappedUrl="~/index.aspx?pid=01" /> <add url="~/contacts.aspx" mappedUrl="~/index.aspx?pid=02" /> <add url="~/sales.aspx" mappedUrl="~/index.aspx?pid=03" /> </urlMappings> </system.web>
显然,您需要根据自己的需要调整页面和标题.
Obviously you need to adjust the pages and titles to your own needs.
更多推荐
隐藏最终用户的链接
发布评论