Can I access the query string using JavaScript?
A query string is an optional part of a URL that goes after the file name and begins with a questionmark. For eg the query string will be as http://www.sitedemo/com/home.htm?newquerystringadded. Here querystringvalue is the newquerystringadded. The query string can be added and it can be retrieved as shown, <div> <input type=button value=’AddQueryString’ onClick=’self.location= self.location.protocol+’//’ +self.location.host +self.location.pathname+’?addquerystring’’> <input type=button value=’ShowQueryString’ onClick=’alert(’Query string Value: ’+self.location.search)’> </div>
How can you make the text to scroll in the window’s status bar?
The text can be made to scroll using the javascript codings as below. <html> <head> <title> Scrolling Text On Window Status Bar </title> <script language=’javascript’> // Scrolling Status Bar var delay = 60; var message = ‘Syncfusion – .Net Essentials’; message += ‘ Text Scrolling In Window Status Bar’; var spaceslength = 130; var spaces = ”; for (var c = 0; c < spaceslength; c++) spaces += ‘ ‘; function init() { timer = setTimeout(’scroll(130)’, 500); } function scroll(position) { var startMessage = ”; var cmd = ”; if (position > spaceslength) { position–; cmd = ‘scroll(‘ + position + ‘)’; timer = setTimeout(cmd, delay); } else if (position <= spaceslength && position > 0) { startMessage = spaces.substring(0, position); startMessage += message; position–; cmd = ‘scroll(‘ + position + ‘)’; window.status = startMessage; timer = setTimeout(cmd, delay); } else if (position <= 0) { if (-position < message.length) { startMessage += message.substring(-position, message.length); startMessage += spaces.substring(0, spaces.length / 4); startMessage += message; position–; cmd = ‘scroll(‘ + position + ‘)’; window.status = startMessage; timer = setTimeout(cmd, delay*3); } else { cmd = ‘scroll(‘ + spaces.length / 4 + ‘)’; timer = setTimeout(cmd, delay); } } } </script> </head> <body bgcolor=’#ffffff’ onLoad=’init()’> <blockquote> <h4>JavaScript Demonstration- Scrolling Text On Window Status Bar</h4> </blockquote> <hr/> </body> </html>
How can I know if the client browser supports active scripting
You can detect and intercept the capabilities of your client using the namespace System.Web.HttpBrowserCapabilities : VB.NET Dim browser As System.Web.HttpBrowserCapabilities = Request.Browser Response.Write(‘Support ActiveXControl: ‘ + browser.ActiveXControls.ToString()) C# System.Web.HttpBrowserCapabilities browser = Request.Browser; Response.Write (‘Support ActiveXControl: ‘ + browser.ActiveXControls.ToString ()); For more details Refer: Detecting Browser Types in Web Forms
How can the default focus can be set when a error occurs?
We can set SetFocusOnError=’true’ for the ASP.NET validators, So that the first control with the validation error will receive the default focus when the form is submitted. First Name: <asp:TextBox ID=’TextBox1′ runat=’server’></asp:TextBox> <asp:RequiredFieldValidator SetFocusOnError=’true’ ErrorMessage=’TextBox1 is empty’ ID=’RequiredFieldValidator1′ ControlToValidate=’TextBox1′ Display=’Dynamic’ runat=’server’>* </asp:RequiredFieldValidator> Last Name: <asp:TextBox ID=’TextBox2′ runat=’server’></asp:TextBox> <asp:RequiredFieldValidator SetFocusOnError=’true’ ErrorMessage=’TextBox2 is empty’ ID=’RequiredFieldValidator2′ ControlToValidate=’TextBox2′ Display=’Dynamic’ runat=’server’>* </asp:RequiredFieldValidator> Here SetFocusOnError is set to true for the validation control, so that the TextBoxes gets focused when it is empty.
Why do I get error message ”Parser Error Message: Access is denied: Source Error: Line xxx :<add assembly='*'/> ”
The actual problem is because of the Microsoft Indexing Services which scans the Temporary ASP.NET Files and while doing so, the system puts a lock on the same. To resolve this, the following steps need to be carried out:- Start – Settings – Control Panel – Administrative Tools – Computer management. Expand the services and applications node and select the Indexing service node. Expand the Indexing Service Node and then select and expand the System Node. Right click on Directories and select new directory. browse the path to the temporary asp.net files c:\winnt\microsoft.net\framework\v1.1.4322\. Select the temporary asp.net files. give ok and then select the ‘NO’ in the Include in index radiobutton. give ok and then stop and start the indexing service.