将查询字符串替换为清除URL [英] Replace query string to clean url

查看:91
本文介绍了将查询字符串替换为清除URL的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我目前正在开展一个演示项目。在这里,我需要创建动态页面,其中用户提供页面名称和内容应该显示的页面模板(内容容器)和内容。现在这里模板是指带有占位符的预构建设计。



现在,我正在创建一个新页面,我提供PageName作为PageNameFromUser和Templating1.aspx作为模板页面然后我存储它就像



PageId | GenerateUrl | PageName |

1001 | 〜/ Template1.aspx?ID = 1001| PageNameFromUser |



所以当我导航到那个页面时,我会有`localhost / Template1.aspx?ID = 1001`。但是我希望url应该生成像`localhost / CustomPageNamefromUser`



如何实现这个?需要帮助



我尝试了什么:



请在这里需要帮助伙计。我不知道如何实现这个目标?

I am currently working on a demo project. Here I need to create dynamic pages where user supply page name and page template(content container) where content should display, and contents.Now here Template(s) refers to as pre-built design with placeholder.

Now, I am creating a new page and I am providing PageName as PageNameFromUser and Templating1.aspx as template page then I am storing it like

PageId | GenerateUrl |PageName |
1001 | "~/Template1.aspx?ID=1001"|PageNameFromUser |

So when I navigate to that page I would I have `localhost/Template1.aspx?ID=1001`. But I want url should generate like `localhost/CustomPageNamefromUser`

How to achieve this one? Help needed

What I have tried:

Help needed here please guys.I don't know how to achieve this ?

推荐答案

参考这些

URL在ASP.NET中重写 [ ^ ]

URL在ASP.NET C#中重写 [ ^ ]

如何使用Asp.net中的路由进行URl重写c#代码 - YouTube [ ^ ]
refer these
URL Rewriting in ASP.NET[^]
URL Rewriting in ASP.NET C#[^]
How to do URl Rewriting using Route in Asp.net c# code - YouTube[^]


这篇关于将查询字符串替换为清除URL的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆