Javascript 如何在asp.net c#中更改url?
我正在尝试在ASP.net应用程序中创建搜索选项,以根据位置检查医生详细信息。如果我尝试下面的代码,只显示主页<代码>http:www.example.com/doctordetails.aspx?ID=1/DoctorName=IVINJavascript 如何在asp.net c#中更改url?,javascript,c#,asp.net,url,url-rewriting,Javascript,C#,Asp.net,Url,Url Rewriting,我正在尝试在ASP.net应用程序中创建搜索选项,以根据位置检查医生详细信息。如果我尝试下面的代码,只显示主页http:www.example.com/doctordetails.aspx?ID=1/DoctorName=IVIN 我希望URL根据位置进行更改。预期URL示例:http://www.example.com/doctordetails/chennai/doctors/saidapet 我不熟悉这项技术 <asp:Repeater ID="rptCustomers" runa
我希望URL根据位置进行更改。预期URL示例:
http://www.example.com/doctordetails/chennai/doctors/saidapet
我不熟悉这项技术
<asp:Repeater ID="rptCustomers" runat="server">
<HeaderTemplate>
<div class="tg-view tg-grid-view">
<div class="row">
</HeaderTemplate>
<ItemTemplate>
<article class="tg-doctor-profile">
<div class="tg-box">
<figure class="tg-docprofile-img"><a href="#"><img src="images/doctors/img-13.jpg" alt="image description"></a></figure>
<span class="tg-featuredicon"><em class="fa fa-bolt"></em></span>
<div class="tg-docprofile-content">
<div class="tg-heading-border tg-small">
<h3><a href="<%# String.Format("doctordetails.aspx?ID={0}/DoctorName={1}", Eval("DoctorID"),Eval("DoctorName")) %>"><asp:Label ID="lblName" runat="server" Text='<%# Eval("DoctorName") %>' /></a></h3>
</div>
<div class="tg-description">
<p>Lorem ipsum dolor sit amet, consectetur aicing elit, sed do eiusmod tempor incididunt.</p>
</div>
<ul class="tg-doccontactinfo">
<li>
<i class="fa fa-map-marker"></i>
<address><asp:Label ID="lbladdress" runat="server" Text='<%# Eval("DocAddress1") %>' /></address>
</li>
<li>
<i class="fa fa-phone"></i>
<span><asp:Label ID="lblMobile" runat="server" Text='<%# Eval("Mobile") %>' /></address></span>
</li>
<li>
<i class="fa fa-envelope-o"></i>
<a ><asp:Label ID="lblmail" runat="server" Text='<%# Eval("Email") %>' /></a>
</li>
<li>
<i class="fa fa-fax"></i>
<span>+44 235 856843</span>
</li>
</ul>
</div>
</div>
</article>
</ItemTemplate>
<FooterTemplate>
</div>
</div>
</FooterTemplate>
</asp:Repeater>
洛雷姆·伊普苏姆·多洛·希特,一位杰出的青年,在临时政府中任职
-
-
-
-
+44 235 856843
希望您希望通过查询字符串传递多个参数,并以特定形式访问这些值。如果是这样,您必须按如下方式更改代码:
<a href="<%# String.Format("doctordetails.aspx?loc={0}&ID={1}&DoctorName={2}", Eval("Location"),Eval("DoctorID"),Eval("DoctorName")) %>"></a>
有点不清楚您所问的是什么,请您明确一下您的实际需求好吗?我希望像这个url@un-luckyUse&指定多个查询字符串。示例:
ID=1&DoctorName=IVIN
我是这项技术的新手。先生,请帮助我,我能做什么?@GhasanI希望URL根据位置进行更改。示例Live URL……显示错误系统。数据。DataRowView“不包含名为“location”的属性@un Lucky希望您在用于绑定网格视图的集合中有DoctorID
,如wise includeLocation
,以及在集合中是的,它正在使用此url,但我希望此url@un Lucky我想您误解了url的含义
Request.QueryString["Location"]; // Will give you the passed value for location
Request.QueryString["DoctorID"]; // Will give you the passed value for DoctorID
Request.QueryString["DoctorName"]; // Will give you the passed value for DoctorName