Thea Burger's Blog

Wouldn't you like to know...

News

Photo's!!!

About me

I'm Reading: General Blogs

I'm Reading: Technical Blogs

Browse by Tags

All Tags » Trial & Error (RSS)
IFRAME - loading pages dynamically
I wanted to load pages dynamically into an IFRAME, but then I realised that you can't access the src attribute from code-behind, not even if you add runat=server... Here is the solution: 1. Add runat=server to the IFRAME. 2. In the declarations section declare a HtmlGenericControl protected System.Web.UI.HtmlControls.HtmlGenericControl frame1; 3. Find your IFRAME :) HtmlControl frame1 = (HtmlControl)this.FindControl("frame1"); 4. Lastly, to access your IFRAME's src attribute: frame1.Attributes["src...
EMAB EventLog errors
I decided to use the Exception Management Application Block in our application, but after I installed it and tried to test it I got the following error: System.Security.SecurityException: Requested registry access is not allowed . After searching and suggestions that I should modify the registry I got this correct answer: Run installutil “<path>\Microsoft.ApplicationBlocks.ExceptionManagement.dll" Unfortunately after that I got the next error: System.ComponentModel.Win32Exception: Access...
Upgrading Oracle 9i to Release 2
Yesterday we needed to upgrade our server's Oracle Client from 9i to 9i Release 2. Got the error “Unable to load DLL (OraOps9.dll)” after we started using the ODP.Net provider and hoped this would fix the error. And I thought it was a simple thing to do. So I came in early, 'deinstalled' the old one, which actually doesn't remove the Oracle Home (ora90 at that stage), and also doesn't update the registry (this I only found out later). I saw that the old folders & files were still...
Datagrid: Get selected row's pageIndex
The Problem: You have a multi page datagrid and you want to display and highlight the selected row which has been set programmatically. The datagrid doesn’t have built in functionality which you can use to determine on which page the row with the selectedIndex is. Solution: I have a datagrid on my page, dgPaging, and AllowPaging = True and the PageSize = 5. In Page_Load I load the datagrid with data that I get from SQL. I also use the following to store the count of the items in the dataset, because...
IIS won't start
If you get a problem that your IIS won't start or when you try to start WWW Publishing Service and it gives you the error: Error 1717: The interface is unknown. Make sure your Event Log Service is started... Share this post: email it! | bookmark it! | digg it! | reddit! | kick it! | live it!
Dte.olb could not be loaded
After reinstalling my pc, (had to after I tried to crack something (I steer clear of this now :)) I got the following error when trying to open a newly installed Visual Studio.NET: “Dte.olb could not be loaded. Please re-run setup and repair your installation” So I repaired my installation and after it I still got the error. I found the solution on Shannon Shang's blog: Basically this COM object didn't register succesfully, so after registering it again it worked perfectly :D regsvr32...
KB823718 keeps installing - every day!!
Every day for the past 3 weeks my Windows Update popped up and told me there are new updates to install. Fine, but each and every day it is MDAC 2.8 (KB823718). Believe me, after a while it can drive you crazy!! I sent our sys admins an email and I got a response that this is because of one of the trial version programs that I installed and that when I uninstalled it, it deleted some dll's and this will keep on happening untill I reinstall my OS. Riiight, funny that it only happens with KB823718...
Redirect to login page when asp.net session expires
Still sort of on the same topic, we want our users to be redirected to the login page when the session has expired. Can't add the neccesary code in Session_End as there is no HttpRequest when the server fires Session_End, so Response.Redirect/Server.Transfer won't work. I found a solution here that Andrew Hopper posted, and it works like a bomb. “Create a base class that inherits from System.Web.UI.Page. Add a virtual void Page_Load method with the '(Object sender, EventArgs e)' parameters...
FormsAuthenticationTicket, IsPersistent and HttpCookie.Expires
I'm using Forms Authentication and Role based security for an app I'm working on. Ran into a problem that even though I set the IsPersistent parameter of the FormsAuthenticationTicket to true, next time I open the app I have to log in again... authTkt = new FormsAuthenticationTicket(1, userId, DateTime.Now, DateTime.Now.AddYears(1), true , userRoles); Well, doh, the plain and simple answer is that you need to set the expiry date of the cookie, otherwise it expires when the user closes the browser...
UserControl Events Handled by Page
Maybe you'll need it someday, maybe you've done it, maybe not :) But I needed to raise an event from a usercontrol, which had to be handled in the containing page. Why? Because I created a RowFilter for a DataView in the usercontrol, and this DataView needs to be bound to a DataGrid on the page. There may be other/better ways, but this worked for me: The code in the usercontrol: //Declare custom public event handler public event EventHandler Bind; private void btnFilter_Click( object sender, System...
SQL Server Service Did Not Start Due to a Logon Failure
This is an error that I have received a couple of times previously. The first time I couldn't understand what was going on, as I didn't change my SQL password or anything... After some investigation I saw that this is due to SQL Server logging on with a domain account and my domain password expired and I changed it. Quickfix: 1. Go to Services in Administrative tools. 2. Open MSSQLSERVER and click on the Log On type. 3. Enter your domain password. And voila! - your SQL is back to normal. What you...
Errors: Type Abstract and Key in appSettings does not exist
I ran into a problem yesterday where I have a base class from which all my aspx pages inherit from. When I swithed to design view it gave me the following error: The file could not be loaded into the Web Forms Designer .... Type Abstract. I love google groups and I got the answer there. “The reason for this is that VS doesn't support design view for controls/forms that inherit from abstract classes. When you open the derived page in the designer, VS.NET needs to create an instance of the Page...
Set Service Login for Windows Service
I was busy setting up a windows service when I got to the 'Set Service Login' dialog box. I entered the details of the local account that I created to run as a service and received the following error: “ System.ComponentModel.Win32Exception: The account name is invalid or does not exist, or the password is invalid for the account name specified ” Very simple error I made, but maybe it can help someone else :) If you created a network account, in the Username field, you have to enter the...
Stylesheet disappears on postback
We experienced a problem today that some of our pages' stylesheet isn't retained on postback. After some investigation we realized that it was all the pages where SmartNavigation was set to true. We removed the SmartNavigation and the problem was solved. I searched for a better solution but I only found people with the same problem and no real solution. Most think it is a bug with SmartNavigation. Any ideas? Share this post: email it! | bookmark it! | digg it! | reddit! | kick it! | live it!