answersLogoWhite

0


Best Answer

If you are referring to handling a link to a page that does not exist, then you can't unless the link was pointing to your application, in which case you can handle it in the Application_Error event in global.asax.

If you are referring to handling a link that causes a postback to your application, and then having an error occur in the Click event, you can trap your logic around a try/catch/finally block. Eg:

protected void Link_Click(object sender, EventArgs e)

{

try

{

// Do something stupid

a = 1/0;

}

catch (Exception ex)

{

ErrorMessage.Text = "Whoops, something went wrong!";

}

}

User Avatar

Wiki User

13y ago
This answer is:
User Avatar

Add your answer:

Earn +20 pts
Q: How do you handle error when you click on a link?
Write your answer...
Submit
Still have questions?
magnify glass
imp
Continue Learning about Engineering

Java error click for details?

error .click for details


What is convoluction?

Wikipedia has a section on this. Click the Wikipedia link below


How do you install links?

1-If your attempting to install a link for uses such as:desktop short cuts, Macros, or general easy accessibility to a certain web address then you must *right-click* the link, left click *save link as* or *save as*, select the location of your computer you want it. If your looking for a fast way to get to a website without having to open your browser and type some stuff in then i recommended you save the link to your *desktop*.2- If your looking to simply download something and you have to click a link to get it then:click the link; if the download doesn't automatically start most websites will have an option to manually start it by clicking another link in a new window usually opened upon the click of the first link. The manual start link will most likely say this "If you download did not start automatically click here"


Describe different ways that a function can handle errors?

There are two ways. The method can have a try catch block and handle the error/exception inside the method. Or The method can throw the exception under the assumption that the calling method would have the code to handle the exception that is thrown by this method


How do you use exception in c sharp?

Exceptions are the error handling mechanism of C#. When an error occurs, an exception is thrown using this syntax: void BadMethod() { bool Error = true; if (Error) { throw new Exception("Whoops!"); } } Methods can then handle exceptions using a try/catch/finally syntax. The code that you are trying to execute goes between a try { } block, the code to handle the error goes between the catch { } block. Any code that you put between the finally { } block will always execute after the exception handling code is complete (or if an error did not occur). void test() { try { BadMethod(); catch (Exception ex) { Console.WriteLine("An error occured. The description is: " + ex.Description); } finally { Console.WriteLine("I'm done!"); } }

Related questions

How do you remove the driver door handle from a 2000 Dodge Neon?

Click on the link to your right for instructions.


Java error click for details?

error .click for details


What happens when ipod has an unknown error?

Click on the link below for more information.


How do you solve the iTunes error 4001?

This is what iTunes error 8012 says: "Error 8012 - There was a problem downloading the artwork for (iTunes item)." Click on the link below to go directly to the Apple iTunes support page:


What happens when you click a table move handle?

Click a table move handle to select the entire table.


What does the Nintendo DSi error code 052103-1 mean?

This means there is a problem with your router's firewall settings. For more information, click the link below.


What do you do after you click the answer link?

you type in your answer or click the "to answer with a web link" to answer with a website


How do you link on nocash gba?

Right click on The Screen and click on link. :]


Nintendo DS cannot connect to the internet code 051310-1?

Basically, the error code has to do with the WEP key for your wireless router. Click on the link in the related links below, or go to support.nintendo.com and enter the error code on the left.


What bus do you get from ashbourne to dublin?

There are buses to Ashbourne. Click on the link below.There are buses to Ashbourne. Click on the link below.There are buses to Ashbourne. Click on the link below.There are buses to Ashbourne. Click on the link below.There are buses to Ashbourne. Click on the link below.There are buses to Ashbourne. Click on the link below.There are buses to Ashbourne. Click on the link below.There are buses to Ashbourne. Click on the link below.There are buses to Ashbourne. Click on the link below.There are buses to Ashbourne. Click on the link below.There are buses to Ashbourne. Click on the link below.


How do you stop error reports?

# Right-Click My Computer # Select Properties # Click on the Advanced Tab # Click on the Error Reporting button # Click Disable Error Reporting # Click OK to save the changes and OK to close the System Properties dialog As an alternative you can disable the Error Reporting service via the Administrative Tools applet in the Control Panel, but the procedure described above is the recommended method of disabling Error Reporting in Windows XP.


How do you report error?

# Right-Click My Computer # Select Properties # Click on the Advanced Tab # Click on the Error Reporting button # Click Disable Error Reporting # Click OK to save the changes and OK to close the System Properties dialog As an alternative you can disable the Error Reporting service via the Administrative Tools applet in the Control Panel, but the procedure described above is the recommended method of disabling Error Reporting in Windows XP.