What is difference between click event of a simple link button and image button control?

Using the Button and LinkButton Click event procedure is straightforward. The ImageButton control provides an additional capability. The Click event argument for the ImageButton control includes the X and Y coordinates for where the user clicked on the control. The image response depends on where it Images that respond to… Continue reading

Writing Cookies code in Asp.Net

Show the code that writes a cookie containing the user name “Rob Young” and the current date to the user’ s computer. Set the cookie to remain on the user’ s computer for 30 days. HttpCookie cookUserInfo = new HttpCookie(“UserInfo”) CookUserInfo[“Name”] = “Rob Young” CookUserInfo[“Time”] = DateTime.Now.ToString() cookUserInfo.Expires = DateTime.Now.AddDays(30)… Continue reading

List two different exception-handling approaches in ASP.NET Web applications.

Exceptions can be handled in exception-handling blocks using the Try, Catch, and Finally keywords in Visual Basic .NET or the try, catch, and finally keywords in Visual C#. They can also be handled using Error event procedures at the Global, Application, or Page levels using the Server object’ s GetLastError… Continue reading

How do u cache a web page in ASP.NET?

<%@ outputcache duration=”60” varybyparam=”none”> What is difference between following statements: <%@ outputcache duration=”60” varybyparam=”none”> <%@ outputcache duration=”60” varybyparam=”*”> <%@ outputcache duration=”60” varybyparam=”name”> Statement 1 caches only one version of the page irrespective of query-string parameters. Statement 2 caches multiple versions of same page I any of query-string parameter varies. Statement… Continue reading

Difference between Server.Transfer and Response.Redirect?

Response.Redirect simply sends a message down to the browser, telling it to move to another page. So, you may run code like: Response.Redirect(“WebForm2.aspx”) or Response.Redirect(“http://www.mysite.com/”) Server.Transfer is similar in that it sends the user to another page with a statement such as: Server.Transfer(“WebForm2.aspx”). However, the statement has a number of… Continue reading