ASPForums.Net RSS Feedhttp://www.aspforums.net/Handlers/RSS.ashxLatest additions to the content that appears on ASPForums.Net(c) 2019 www.aspforums.com. All rights reserved.Read QueryString value from URL using jQuery<p>Hi&nbsp;jovceka,</p> <p>Refer below code.</p> <p><strong><span style="text-decoration: underline;">Global.asax </span></strong></p> <pre class="brush: csharp">&lt;%@ Application Language=&#34;C#&#34; %&gt; &lt;%@ Import Namespace=&#34;System.Web.Routing&#34; %&gt; &lt;script runat=&#34;server&#34;&gt; void Application_Start(object sender, EventArgs e) { RegisterRoutes(RouteTable.Routes); } static void RegisterRoutes(RouteCollection routes) { routes.MapPageRoute(&#34;query2&#34;, &#34;query2/{name}&#34;, &#34;~/query2.aspx&#34;); routes.MapPageRoute(&#34;querystring3&#34;, &#34;querystring3&#34;, &#34;~/querystring3.aspx&#34;); } &lt;/script&gt;</pre> <p><strong><span style="text-decoration: underline;">HTML</span></strong></p> <p><span style="text-decoration: underline;">querystring1.aspx</span></p> <pre class="brush: html">&lt;script type=&#34;text/javascript&#34; src=&#34;https://code.jquery.com/jquery-2.2.3.js&#34;&gt;&lt;/script&gt; &lt;script type=&#34;text/javascript&#34;&gt; $(function () { var name1 = $(&#39;#txtName&#39;).val(); $(&#34;#btnQueryString&#34;).bind(&#34;click&#34;, function () { var url = &#34;query2/&#34; + encodeURIComponent(name1); window.location.href = url; }); }); &lt;/script&gt; &lt;input type=&#34;text&#34; id=&#34;txtName&#34; name=&#34;Name&#34; value=&#34;sam&#34; /&gt; &lt;input type=&#34;button&#34; id=&#34;btnQueryString&#34; value=&#34;Send&#34; /&gt;</pre> <p><span style="text-decoration: underline;">query2.aspx</span></p> <pre class="brush: html">&lt;script type=&#34;text/javascript&#34; src=&#34;https://code.jquery.com/jquery-2.2.3.js&#34;&gt;&lt;/script&gt; &lt;script type=&#34;text/javascript&#34;&gt; $(function () { $(&#34;#label1&#34;).html(window.location.toString().split(&#39;query2/&#39;)[1]); $(&#34;a&#34;).click(function (e) { e.preventDefault(); var url = &#34;querystring3&#34;; window.location.href = window.location.href.split(&#39;query2&#39;)[0] + url; }); }); &lt;/script&gt; &lt;a href=&#34;javascript:;&#34;&gt;click&lt;/a&gt; &lt;br /&gt; &lt;span id=&#34;label1&#34;&gt;&lt;/span&gt;</pre> <p><span style="text-decoration: underline;">querystring3.aspx</span></p> <pre class="brush: html">&lt;div&gt;querystring3 page&lt;/div&gt;</pre> <p><strong><span style="text-decoration: underline;">Screenshot</span></strong></p> <p><strong><span style="text-decoration: underline;"><img src="https://i.imgur.com/BcBwCGh.gif" alt="" width="472" height="84" /></span></strong></p>https://www.aspforums.net:443/Threads/784559/Read-QueryString-value-from-URL-using-jQuery/https://www.aspforums.net:443/Threads/784559/Read-QueryString-value-from-URL-using-jQuery/Wed, 15 May 2019 00:40:17 GMT