如何在ASP.NET中从数据库添加动态标题以显示在Google搜索结果中 [英] How to add dynamic title in ASP.NET from database to appear in Google Search Results

查看:92
本文介绍了如何在ASP.NET中从数据库添加动态标题以显示在Google搜索结果中的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个页面列出了各个城市的商店,商场。

我使用了DropDownList中的城市列表。

我已经为页面添加了动态标题喜欢

I have a page which lists stores,malls of individual cities.
I have used the list of cities in DropDownList.
I have added dynamic title to page as like

Page.Title="Stores in"+DropDownList1.SelectedValue;



工作正常。但是,当我在Google搜索中看到该页面时,它只显示一个标题,例如

德里商店。这里'Delhi'是DropDownList1中的默认选择值。

但由于我在DropDownList1中有很多城市,我想根据搜索显示DropDownList1的每个值作为标题出现在搜索结果中查询。

例如,如果用户键入搜索查询斋浦尔商店,则搜索结果应显示带有此标题的结果斋浦尔商店

请记住,动态标题正在运行很好,但问题是如何显示在搜索结果中


It works fine. But when I see that page in Google Search then its showing only one title like
"Stores in Delhi". Here 'Delhi' is in the default selected value in DropDownList1.
But as I have many cities in that DropDownList1, I want to show each value of DropDownList1 to be appear in search result as title according to search query.
For example if user types search query "Stores in Jaipur" then search result should show result with this title "Stores in Jaipur"
Remember that Dynamic title is working fine but question is that "How to show is in search result"

推荐答案

尝试将此代码放在 Page Init 事件而非页面加载事件

请参阅 [< a href =http://msdn.microsoft.com/en-us/library/ms178472.aspxtarget =_ blanktitle =New Window> ^ ] ..
Try to put this code on Page Init event instead of Page Load event
See this[^]..


这篇关于如何在ASP.NET中从数据库添加动态标题以显示在Google搜索结果中的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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