Why does my ASP.NET file have multiple <form> tag with runat=server?
This means that ASP.Net is not properly registered with IIS. .Net framework provides an Administration utility that manages the installation and uninstallation of multiple versions of ASP.NET on a single machine. You can find the file in C:\WINNT\Microsoft.NET\Framework\v**\aspnet_regiis.exe use the command: aspnet_regiis.exe -u ---> to uninstall current asp.net version. use the command: aspnet_regiis.exe -i ---> to install current asp.net version. For Windows Server 2003, you must use aspnet_regiis -i -enable This is because of the ‘Web Service Extensions’ feature in IIS 6 (if you install VS.NET or the framework without IIS installed, and then go back in and install IIS afterwards, you have to re-register so that ASP.NET ’hooks’ into IIS properly.’
Why does the SmartNavigation does not work on the live server but works perfectly on the Development Machine
May be the domain does not have access to the aspnet_client folder which is located in the wwwroot folder. i.e the website is not able to find the scripts for smart navigation. So set up a virtual folder to the wwwroot/aspnet_client and it will fix the problem.
How to create dynamic javascripts in server side code based on server side variables?
Here’s and example: VB.NET Dim value As String = 'pic1.jpg' Button1.Attributes('onMouseOver') = 'alert( ’' + value + '’);' C# string value = 'pic1.jpg'; Button1.Attributes['onMouseOver'] = 'alert( \'' + value + '\');' ;
How to get the confirmation of Yes/No from a javascript pop-up and display the value on the page
Code Behind Button1.Attributes.Add('onclick', 'getMessage()') Client Side <SCRIPT language=javascript> function getMessage() { var ans; ans=window.confirm(’Is it your confirmation.....?’); if (ans==true) { document.Form1.hdnbox.value=’Yes’; } else { document.Form1.hdnbox.value=’No’;} } </SCRIPT> To display the Yes/No value selected by user, in your code behind file: Response.Write(Request.Form('hdnbox'))
Why can’t I open a new browser window from within server code?
Server code executes on Server, whereas the new window is created on the client. You need to use client-side script to open new window.