Nitin Varpe
Nitin Varpe

Reputation: 10694

Get method passing all values on form mvc3

 @using (Html.BeginRouteForm("ProductSearch", FormMethod.Get))
    {
        <div class="page-title">
            <h1>Search</h1>
        </div>
        <div class="clear">
        </div>
        <div class="search-inut">
   //here there is code for product box of each product satisfying search condition
}

All products are passed as querystring, any way to avoid it? e.g

http:\localhost:54632\mysite\q=sugar&sugar 5kg=1&sugar free=1..............

all the products in search result are added in querystring

Thanx

Upvotes: 0

Views: 127

Answers (1)

user247702
user247702

Reputation: 24212

Change

    //here there is code for product box of each product satisfying search condition
}

to

}
//here there is code for product box of each product satisfying search condition

MVC isn't like Web Forms (where your entire page was in a form), you can safely put parts outside the form.

Upvotes: 1

Related Questions