0

i have a very annoying problem... i had a textbox and a link in my master page. i wanted to use the link button to pass the text of textbox as a query string for some filtring stuff.
but i understood that the cod behind of link bottun doesnt work at all and it just refresh the page.
i tried to do it by jquery by window.location.href but it only worked at the first page and other pages couldnt get the postback.
i changed everything and tried to use radsearchbox. this control works fine but it only works in every page except the main page. let me be more clear:

it works great onhttp://kalashabakeh.ir/product.aspx?groupID=1&subgroupID=0

but it doesnt work at www.kalashabakeh.ir

i really dont know what can couse so many problems. maybe my script manager or a js file or something?
plz help me!

here is my current code with radsearchbox:
in masterpage.master:

<telerik:RadSearchBox runat="server" ID="RadSearchBox2"
            CssClass="searchBox" Skin="Silk"
            Width="200" DropDownSettings-Height="300"
            DataSourceID="SqlDataSource_search"
            DataTextField="product_name"
            DataValueField="product_key"
            EmptyMessage="جستجو..."
            Filter="Contains"
            MaxResultCount="20"
            OnSearch="RadSearchBox2_Search">
</telerik:RadSearchBox>

in master page codebehind:

protected void RadSearchBox2_Search(object sender, SearchBoxEventArgs e)
{

       Response.Redirect("product.aspx?searchID="+ e.Text.ToString(),false);

}

2 Answers2

0

Is it a typo or something like that. Your Rad searchbox control ID is RadSearchBox2 and it's calling a event handler named RadSearchBox2_Search whereas you are having a handler method named RadSearchBox1_Search. See below pointed

<telerik:RadSearchBox runat="server" ID="RadSearchBox2"
 .....
            OnSearch="RadSearchBox2_Search"> <--Here
</telerik:RadSearchBox


protected void RadSearchBox1_Search(object sender
                    ^-------- Here
Rahul
  • 76,197
  • 13
  • 71
  • 125
  • thank you very much for your respond, but that was my mistake to post the quastion. in my code i have radsearchbox2_search. i have edited the post right now. thank you for the recall. – Ashkan Hafezi May 30 '15 at 15:24
  • You are redirecting it to `product.aspx`. are you sure that's not your default starting page (or) home page? What's your home page name? – Rahul May 30 '15 at 17:03
  • my home page is Defualt.aspx – Ashkan Hafezi May 30 '15 at 20:24
0

i finally found the answer... as people discussed here
its a kind of a bug in iis7... this code solved my problem thank to Eric
just add this code in master page.
public void Page_PreRender(object sender, EventArgs e) { if (string.IsNullOrEmpty(this.Page.Form.Action) && Request.Url.AbsolutePath.ToLower().EndsWith("/default.aspx")) this.Page.Form.Action = "Default.aspx"; }
Now i can light up my cigurate ...

Community
  • 1
  • 1