0

I'm trying to create search option in my ASP.net application to check Doctor details based on Location. If I try the below code, only home page is showing. http:www.example.com/doctordetails.aspx?ID=1/DoctorName=IVIN.

I want the URL to be changed as per location. Example expected URL: http://www.example.com/doctordetails/chennai/doctors/saidapet

I'm new to this technology.

 <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>
8
  • Little bit unclear that what you are asking, Could you please be clear about your actual requirements? Commented Jan 16, 2017 at 5:33
  • i want like this url practo.com/chennai/doctors/saidapet @un-lucky Commented Jan 16, 2017 at 5:34
  • Use & to specify multiple query strings. Example: ID=1&DoctorName=IVIN Commented Jan 16, 2017 at 5:34
  • I'm new to this technology. Please help me sir what can i do ?@Ghasan Commented Jan 16, 2017 at 5:35
  • I want the URL to be changed as per location.Example Live Url practo.com/chennai/doctors/saidapet...... Commented Jan 16, 2017 at 5:37

1 Answer 1

2

Hope that you wanted to pass multiple params through query string and access those value in that particular form. if so you have to change the code like this:

<a href="<%# String.Format("doctordetails.aspx?loc={0}&ID={1}&DoctorName={2}", Eval("Location"),Eval("DoctorID"),Eval("DoctorName")) %>"></a>
                                        

And the code for accessing those values is:

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
Sign up to request clarification or add additional context in comments.

6 Comments

showing error System.Data.DataRowView' does not contain a property with the name 'Location'. @un-lucky
Hope that you have DoctorID in the collection that you are used to bind the grid view, like wise include Location as well in the comllection
yes it's working localhost:49247/… this url
I think you ware misunderstand the meaning of URL
|

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.