How to Handle Resource Key Exception
Could not find the specified key "Resource_Key1" or class id "Resource_Class"
<h6> <%=GetGlobalResourceObject("Resource_Class", "Resource_Key1")%> </h6>
Is there any way I can handle this Exception and know that the key is unavailable. besides using try catch in my control
Hello Moiz Ahmed,
There's no way to handle the exception if you're declaring the resource in the control template. However, you can do it through code.
You can manually retrieve the value of a resource using the Res class's Get method. There are many overloads of this method, and one of them accepts a boolean argument which indicates whether an exception should be thrown or not.
You can find the API reference for this method here.