Link to home
Start Free TrialLog in
Avatar of ITsolutionWizard
ITsolutionWizardFlag for United States of America

asked on

asp.net xml

I have below front end and xml file. If I enter full address and select 10 miles
how can i read the xml
and find the list of <Rv> that within 10 miles?


<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
    <title></title>
</head>
<body>
    <form id="form1" runat="server">
    <div>
        <asp:TextBox runat="server" ID="fullAddress"></asp:TextBox>
        <asp:DropDownList runat="server" ID="miles">
            <asp:ListItem Text="10" Value="10"></asp:ListItem>
            <asp:ListItem Text="20" Value="20"></asp:ListItem>
        </asp:DropDownList>
        <asp:Button runat="server" ID="submit" OnClick="submit_Click" Text="Search" />
     </div>
    </form>
</body>
</html>


<?xml version="1.0" encoding="utf-8" ?>
<Root>
  <Rv>
    <ID>1</ID>
    <StreetName>1000 Main Street</StreetName>
    <City>Alhambra</City>
    <State>CA</State>
    <Zip>90032</Zip>
  </Rv>
  <Rv>
    <ID>2</ID>
    <StreetName>2000 Main Street</StreetName>
    <City>Houston</City>
    <State>TX</State>
    <Zip>90032</Zip>    
  </Rv>
  <Rv>
    <ID>3</ID>
    <StreetName>2000 Main Street</StreetName>
    <City>Pensacola</City>
    <State>FL</State>
    <Zip>35023</Zip>    
  </Rv>
</Root>
Avatar of Anil Golamari
Anil Golamari
Flag of United States of America image

Hi,

The xml that you have provided doesn't talk anything about number of miles or anything. Are you planning to use google api to pinpoint the input location and then provide 10mile radius address?

Below link has sample code which may be useful in your case.

http://stackoverflow.com/questions/29791713/search-by-zip-code-and-filter-list-within-specific-radius
Avatar of ITsolutionWizard

ASKER

No. I do not need to validate the zip code.

My goal is to read the xml and try to get list of <RV> that up to like 10 miles (selected)
Is this is the exact xml file that you are expected to work on because I see some issues here with the requirement.

There is no way that we can find or filter list of rv with in xml file with given xml file because an user has selected an address in Houston TX but there is no way that we can pick up the Houston texas address with out validating or looking up for Zip codes. Only way we can do is if some one enters Houston we can query through whole xml and give list of rv available in that city.
again. don't have to worry the validation address. the address will be correct.
ASKER CERTIFIED SOLUTION
Avatar of Karrtik Iyer
Karrtik Iyer
Flag of India image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
It is okay. we just wait more experts to help.