c# - SEO 友好 URL asp.net 动态喜欢 http://somewebsite/WebForm1.aspx?postid=1
问题描述
尊敬的查看者,我有一个问题,我在 asp.net 网络表单 webform1 和 webform2 中有 2 页现在我们将数据库中的数据绑定到网格视图中的 webform 1 上,只显示类似于 ex 的标题。苹果现在从数据库绑定,当用户点击苹果时,我们使用响应重定向http://somewebsite/WebForm2.aspx?postid=1这样的页面将在 webform 2 上重定向,并且从数据库中绑定数据仅关于苹果意味着 ID= 在哪里1 但我想做 http://somewebsite/WebForm2/postid/1/Apple Like in this format Get this url and fetch details about only Apple from database (apple is just used for example) we can do this i much try并在 google 和 youtube 上搜索,但我没有成功
希望有人帮助我解决这个问题
我已经尝试从 stackoverflow 网站查看我已经看到一个对 seo 友好的东西,但它明确声明或者我不明白:(
解决方案
我们使用 Global.asax 这是一个代码示例 我们只需要路由 URL
using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.Security;
using System.Web.SessionState;
using System.Web.Routing;
namespace a2zcrackworld
{
public class Global : System.Web.HttpApplication
{
void RegisterRoutes(RouteCollection routes)
{
routes.MapPageRoute("Home", "software", "~/software.aspx");
routes.MapPageRoute("Downloadsoft", "download/soft/{SoftwareID}", "~/downloadsoftware.aspx");
routes.MapPageRoute("Opratingsystem", "operating", "~/OpratingSystem.aspx");
}
void RegisterRoutessoftware(RouteCollection routes)
{
}
protected void Application_Start(object sender, EventArgs e)
{
RegisterRoutes(RouteTable.Routes);
RegisterRoutessoftware(RouteTable.Routes);
}
}
推荐阅读
- ruby - 错误:启动 jekyll 服务器时未初始化的常量 FFI::Platform::CPU
- r - 什么是简单混合模型代码 (R) 中的“+0”?
- html - 如何防止一个标签破坏另一个标签的居中
- javascript - Tinymce 能否给我一些保留所有样式的准确 HTML 内容(真的是所见即所得)?
- c++ - stat.h 在标准文件中的字符串常量 __BEGIN_DECLS 之前预期不合格 ID
- html - background 和 background-color 不适用于 Redmi 手机附带的默认浏览器
- jquery - 为什么我的 CSS 动画只有在第一次触发时才播放?而不是在随后的触发器上?
- c# - 电子邮件验证比较表单不返回错误消息
- d3.js - D3v4:将文本添加到 d3.symbolCircle 的中心
- javascript - 如何使用电子表格中的值创建下拉菜单?