Getting query string values ​​without full postback

I have a page in which the left column contains a list of categories, and the right column displays the corresponding items when you select a specific category from the left

each category’s list contains a hyperlink whose navigation URL contains query string values.

when I click the link, I get the elements listed on the right corresponding to the querystring value

Question: I want to prevent a complete postback and at the same time to catch the values ​​of querystring, without which I could not get a list of elements on the right.

I used the update panel, but the full record is returned again.

is there any way to get query string values ​​without full postback ???

<asp:UpdatePanel ID="UpdatePanel1" runat="server"> <ContentTemplate> <div class="rightsec"> <h5>Categories</h5> <asp:Accordion ID="Accordion1" runat="server"> <Panes> <asp:AccordionPane ID="AccordionPane1" runat="server"> <Header> <h4> Electronics</h4> </Header> <Content> <div class="rightsec_content"> <ul> <li> <asp:HyperLink ID="HyperLink2" runat="server" NavigateUrl="show_products.aspx?category=Electronics&sub_category=Cameras Accessories">Camera Accessories</asp:HyperLink> </li> </ul> </div> </Content> </asp:AccordionPane> </asp:Accordion> </div> </ContentTemplate> </asp:UpdatePanel> <asp:UpdateProgress ID="UpdateProgress1" runat="server" AssociatedUpdatePanelID="UpdatePanel1"> <ProgressTemplate> <table align="center"> <tr> <td> <asp:Image ID="Image1" runat="server" ImageUrl="~/staticimages/progress_bar_animated (1).gif" ImageAlign="Top" /> </td> </tr> </table> </ProgressTemplate> </asp:UpdateProgress> 
+4
source share
3 answers

Well, yes, you can do it, but it is not an easy task.

You need to write JQUERY and use AJAX with this.

And using this, you can easily achieve this.

I am not very familiar, but it is, but I know that this can be done using AJAX and JQUERY.

You may also need to add some web services to your project in order to achieve this.

This link can help you http://api.jquery.com/jQuery.ajax/ .

+1
source

You can put that value in the CommandArgument property of your link button, and then you can access it in code like ...

 protected void lbtn_Click(object sender, EventArgs e) { ((LinkButton)(sender)).CommandArgument } 
0
source

You can get it using javascript: http://www.west-wind.com/weblog/posts/884279.aspx

You can then use any ajax method to send it back to the server.

0
source

Source: https://habr.com/ru/post/1347060/


All Articles