Junaid Aziz

Total Ranking points:865

Top Questions

10 how to Completely Remove TFS Source Control Bindings for my project in visual studio 2013 ?

7 Could not load file or assembly 'WebGrease, Version=1.5.1.25624, Culture=neutral, PublicKeyToken=31bf3856ad364e35' or one of its dependencies. The system cannot find the file specified.

7 update or alter a stored procedure programmatically through C# code

7 Your connection isn't private Attackers might be trying to steal your information from mydomain.com (for example, passwords, messages, or credit cards)?

5 Method not found: 'System.Web.HttpContext Sitecore.Pipelines.HttpRequest.HttpRequestArgs.get_Context()' with sitecore 10?

4 How to check if the flags enum value has/contains other flags enum values in c#?

4 Combine the summation of row counts from multiple tables and returned as one value in MSSQL

4 window.onload() is not firing in IE while same code working fine in chrome

4 what is the difference between view and Stored Procedure (view vs stored procedure) in sql?

4 What is the main difference between “nofollow” and “noreferrer” link from SEO perspective?

Top Answers

6 You can check for not null values / get all the records where the field has some value by placing the following filter. { UserId : {$ne : null} }

5 The appearance of "bare" "CR" or "LF" characters in text (i.e., either without the other) has a long history of causing problems in mail implementations and applications that use the mail system as a tool. Simple way to solve this is by removing those character from your email html, you can use the following code for the purpose. emailHtml = emailHtml.Replace("\r", string.Empty).Replace("\n", string.Empty);

4 You can try accessing following known resources that every sitecore website contains, out which some might be blocked explicitly by developers but in most case you will find at least one or more which indicate that the site is build using sitecore. 1) /~/media/System/Template%20Thumbnails/audio.ashx 2) /~/media/System/Simulator%20Backgrounds/blackberry.ashx 3) /layouts/System/VisitorIdentification.aspx 4) /sitecore/shell/sitecore.version.xml

4 Simple solution could be as follows Your controller get method will be like the following method taking the returnUrl as input parameter and setting it to the viewbag. [AllowAnonymous] public ActionResult Login(string returnUrl) { ViewBag.ReturnUrl = returnUrl; return View(); } Now in your MVC view you will be setting the ViewBag.ReturnUrl to ReturnUrl parameter of beginForm as shown below. @using (Html.BeginForm(new { ReturnUrl = ViewBag.ReturnUrl })) Now in your controller post method you will take the your LoginModel as well as returnUrl as an extra parameter. [HttpPost] [AllowAnonymous] [ValidateAntiForgeryToken] public ActionResult Login(LoginModel model, string returnUrl) { // your login login logic would be added here as well. if (ModelState.IsValid)) { return RedirectToLocal(returnUrl); } // In case of failure form displayed again ModelState.AddModelError("", "The user name or password provided is incorrect."); return View(model); } Following method is called in above controller method to make sure that the returnUrl is local url. private ActionResult RedirectToLocal(string returnUrl) { if (Url.IsLocalUrl(returnUrl)) { return Redirect(returnUrl); } else { return RedirectToAction("Index", "Home"); } }

3 If I understand your problem correctly then following code will solve your problem which will allow you appending UrlName of the item after your detail page url. (You can add following line at page_load event as well.) RouteHelper.SetUrlParametersResolved(); To get that UrlName in your detail's widget/control you can create a property in your C# code which will fetch that appended UrlName for you as shown in the following code chunk. private string ItemUrlName { get { string urlName = string.Empty; if (Page != null) { var parms = (string[])Page.Request.RequestContext.RouteData.Values["Params"]; if (parms != null && parms.Length > 0) { urlName = parms[0]; RouteHelper.SetUrlParametersResolved(); } } return urlName; } }

3 Hi, Schema markup, found at www.Schema.org , is a form of microdata. Once added to a webpage, schema markup creates an enhanced description (commonly known as a rich snippet), which appears in search results. Top search engines – including Google, Yahoo, Bing, and Yandex – first started collaborating to create Schema.org, back in 2011. Schema markup is especially important in the age of Hummingbird and RankBrain. How a search engine interprets the context of a query will determine the quality of a search result. Schema can provide context to an otherwise ambiguous webpage. For More details reference Link You can easily implement schema markup to your webpage by using schema.org . After Implementing the schema markup to your webpage you can test the schema markup if it is implemented correctly by using Structured Data Testing Tool

3 ExecuteNonQuery() ExecuteNonQuery method will return number of rows effected with INSERT, DELETE or UPDATE operations. This ExecuteNonQuery method will be used only for insert, update and delete, Create, and SET statements. see more details about ExecuteNonQuery ExecuteReader() ExecuteReader will be used to return the set of rows, on execution of SQL Query or Stored procedure using command object. This one is forward only retrieval of records and it is used to read the table values from first to last. see more details about ExecuteReader ExecuteScalar() ExecuteScalar will return single row single column value i.e. single value, on execution of SQL Query or Stored procedure using command object. It’s very fast to retrieve single values from database. see more details about Execute Scalar

3 SOAP defines a standard communication protocol (set of rules) specification for XML-based message exchange. SOAP uses different transport protocols, such as HTTP and SMTP. The standard protocol HTTP makes it easier for SOAP model to tunnel across firewalls and proxies without any modifications to the SOAP protocol. SOAP can sometimes be slower than middleware technologies like CORBA or ICE due to its verbose XML format. REST describes a set of architectural principles by which data can be transmitted over a standardized interface (such as HTTP). REST does not contain an additional messaging layer and focuses on design rules for creating stateless services. A client can access the resource using the unique URI and a representation of the resource is returned. With each new resource representation, the client is said to transfer state. While accessing RESTful resources with HTTP protocol, the URL of the resource serves as the resource identifier and GET, PUT, DELETE, POST and HEAD are the standard HTTP operations to be performed on that resource. REST vs. SOAP There are significant differences between SOAP and RESTful web services. The bullets below break down the features of each web service based on personal experience. REST -RESTful web services are stateless. You can test this condition by restarting the server and checking if interactions survive. -For most servers, RESTful web services provide a good caching infrastructure over an HTTP GET method. This can improve the performance if the information the service returns is not altered frequently and is not dynamic. -Service producers and consumers must understand the context and content being passed along as there is no standard set of rules to describe the REST web services interface. -REST is useful for restricted-profile devices, such as mobile, for which the overhead of additional parameters are less (e.g., headers). -REST services are easy to integrate with existing websites and are exposed with XML so the HTML pages can consume the same with ease. There is little need to refactor the existing site architecture. As such, developers are more productive because they don't need to rewrite everything from scratch; instead, they just need to add on the existing functionality. -A REST-based implementation is simple compared to SOAP. SOAP -The Web Services Description Language (WSDL) describes a common set of rules to define the messages, bindings, operations and location of the service. WSDL is akin to a contract to define the interface that the service offers. -SOAP requires less plumbing code than REST services design (e.g., transactions, security, coordination, addressing and trust). Most real-world applications are not simple and support complex operations, which require conversational state and contextual information to be maintained. With the SOAP approach, developers don't need to write plumbing code into the application layer. -SOAP web services, such as JAX-WS, are useful for asynchronous processing and invocation. -SOAP supports several protocols and technologies, including WSDL, XSDs and WS-Addressing.

2 Thanks a lot Umer, that DNS cache was the real culprit and the solution worked for me.!

2 Hi umer, There is some limitations when you are using google distance matrix api and for complete details you can read this . and for your concerned part following are some point that are effecting your code. -Maximum of 25 origins or 25 destinations per request. -Maximum 100 elements per server-side request. -Maximum 100 elements per client-side request. -1000 elements per second (EPS), calculated as the sum of client-side and server-side queries. So what you have do is break your destinations into chucks of 25 destinations per request once your destinations count reaches to 100 then for further requests you have to wait for 2 seconds only then you will be able to fetch distance for next 100 destinations.

Top Tags Created

3 IE (Internet Explorer)

3 Google Chrome

3 Stored Procedure

2 Sitecore Unicorn

2 SSL certificate

1 Enum Flags Attribute

1 SOAP(Simple Object Access Protocol)

1 REST(REpresentational State Transfer)

1 SQL View

Top Tags Used

19 Asp.Net

18 ASP.NET MVC

15 C#

8 CMS

7 SQL

7 Sitecore

6 Microsoft Visual Studio

6 MSSQL

5 HTML

5 IIS (Internet Information Services)