query-string

MVC C# activation url redirects to other path

自闭症网瘾萝莉.ら 提交于 2019-12-11 19:37:03
问题 I have code that i used a year or two ago to create an activation link that is send by email, using a code as a parameter, i tried so many different ways, encoding, using other syntax, adding web.config settings <pages validateRequest="false" /> requestValidationMode="2.0" , annotations [AllowHtml] , literally tried dozen of post on the internet but none of them worked. So i am overseeing something here, that i am sure but i can't find the solution. The error i get is: A potentially dangerous

.htaccess redirect to subdomain based on query string parameter

大憨熊 提交于 2019-12-11 19:21:53
问题 I need to set up a redirection to sub domain based on query string. Example: http://example.com/message.php?id=subdomain to http://subdomain.example.com/message.php Is this possible in .htaccess? 回答1: This will redirect all the URLs with QUERY_STRING like id=subdomain and file message.php to the appropriate subdomain: RewriteEngine on RewriteCond %{HTTP_HOST} ^(www\.)?example.com$ [NC] RewriteCond %{QUERY_STRING} ^id=(.*)$ RewriteRule message.php http://%1.example.com/message.php? [R=301,L]

Building filters on DbContext

青春壹個敷衍的年華 提交于 2019-12-11 19:17:29
问题 I have an ASP .Net Core 2.1 Web Api. I was wondering if there is an "elegant solution" for constructing filters on my DbContext based on query strings? So... say I have one [optional] query string: // GET: api/Accounts [HttpGet] public IEnumerable<File> GetAccount([FromQuery] bool? isActive) { if (isActive.HasValue) return _context.Accounts.Where(a => a.IsActive == isActive.Value); else return _context.Accounts; } Simple enough... But say I have a number of (optional) query strings: // GET:

Loop on back button after re-direction with querystring

情到浓时终转凉″ 提交于 2019-12-11 18:14:11
问题 The problem: I need to start with a URL with a query string containing a URL of a second page - http://www.firstURL.com/?http://www.secondURL.com . On the target page of the first URL, the query string is parsed to extract the second URL and the browser is re-directed to the second URL. This is done on $(document).ready so that it's automatic. This all works fine, but of course falls in a hole if the user hits the back button on the second URL. Here's the basic code: $(document).ready

Passing values and saving values temporarily, … use session, hidden field, query string or other?

岁酱吖の 提交于 2019-12-11 17:17:56
问题 This may be a basic question... However I've just been picking a solution without giving much though to it... Consider a page with a grid of forms: /FormList.aspx where choosing to edit a form redirects the user to a page like: /FormEdit.aspx?Id=2 I usually am okay with passing the values in the query string, because I check in the code-behind of FormEdit that the Id is valid. Which is the best way to pass the value , though: session or query string ? Or other? While the user is editing the

How to get an empty parameter from an url like “example.com/id//”?

北慕城南 提交于 2019-12-11 16:27:45
问题 I am using symfony 1.0 and below is the URL which displays the news description. http://news4u.com/search/news/id/344158/css//act/n In the above URL value for CSS is missing and the URL is supposed to be as below http://news4u.com/search/news/id/344158/css/n/act/n When I use $this->getRequestParameter('css') to get the value of css, I get it as 'act' and if the do the same for 'act', I get empty value. $getRequestParameter('css')=act $getRequestParameter('act')=<EMPTY> I am getting values for

how to get the url and the product code contained in it separately

夙愿已清 提交于 2019-12-11 15:17:17
问题 I have a mailer in which i am sending a html page as the mail body. The html page has some links. What i am doing here is identifying those links and replacing those links with a link to my page and sending the link as a parameter in query string along with a parameter 'username' which i enter in a textbox. Here is the code- StreamReader reader = new StreamReader(Server.MapPath("~/one.html")); string readFile = reader.ReadToEnd(); Regex regx = new Regex("(?<!src=\")http(s)?://([\\w+?\\.\\w+])

How can we retrieve query string information in a ClickOnce Application?

风格不统一 提交于 2019-12-11 14:21:18
问题 I made a .NET Windows Forms application that I want to deploy using ClickOnce. However, I will need the application to retrieve the query string parameters passed to it. I found this MSDN article and followed its directions (select the check box labeled Allow URL parameters to be passed to application) , but it doesn't appear to work: How to: Retrieve Query String Information in a ClickOnce Application ApplicationDeployment.CurrentDeployment.ActivationUri is null when the application loads.

How to remove any query except `callback` for specific URLs with RewriteRule?

依然范特西╮ 提交于 2019-12-11 14:07:49
问题 The current RewriteRule removes any query except query callback for any URL. # Remove question mark and parameters RewriteCond %{THE_REQUEST} ^[A-Z]{3,9}\ /([^?#\ ]*)\?[^\ ]*\ HTTP/ [NC] # Query rewrite exceptions ##RewriteCond %{REQUEST_URI}?%{QUERY_STRING} !^/api.*?callback=.* #does not work RewriteCond %{QUERY_STRING} !callback= RewriteRule .*$ %{REQUEST_URI}? [R=301,L] How to avoid query callback rewrite just from URL ^api\/?([^\/]*)$ ? Excepted result: no rewrite for /api?callback=1,

asp link with a QueryString value [closed]

纵然是瞬间 提交于 2019-12-11 13:54:37
问题 This question is unlikely to help any future visitors; it is only relevant to a small geographic area, a specific moment in time, or an extraordinarily narrow situation that is not generally applicable to the worldwide audience of the internet. For help making this question more broadly applicable, visit the help center. Closed 6 years ago . I have a List of Names wrapped in a LinkButton like this <asp:LinkButton CssClass="link_nombre_paciente_espera" runat="server" PostBackUrl="Default.aspx