HTML in user control -
<asp:image Height="33" AlternateText="Powered by WorldPay" Width="139" ImageAlign="AbsMiddle" Runat="server" ID="imageWorldPay"></asp:image>
Code that gives the error in the code behind of the UC -
imageWorldPay.ImageUrl = "~/images/poweredbyworldpay.gif";
Code in...
Yes, it all compiles fine, and the page_load event is fired. But any reference to the form objects in the UC gives the error - Object reference not set to an instance of an object.
The line of code that errors is trying to add the imageurl of an image.
Thanks,
Jenni
I have a solution with 2 projects in it. I need to programatically add a user control from one project into the other one (as you cannot declare this normally on the form because it is in a different application). When the page_load event of the user control is fired at run-time, none of the...
I am adding the records from a class I have written which is all working correctly as I am getting the correct customer name etc returned. I can use this from the Session CustName.
Just to give you a little more info, I am creating these session variables in global.asax.cs. For testing purposes...
I have tested this some more, and there is definitely one row in the dataset. If I fill it with more records, then the session variable works. It only seems to fail when there is only 1 row in it.
The table does still exists as I am binding it to a datagrid which shows the column headings. I have checked and the sessions variable is never overwritten, only ever accessed. It is an odd one.
Thanks for the response. I have written out the row before and after creating the session variable and it is there. It seems to get lost once I have called other pages.
Hi, I hope someone can help.
I am using a session variable to store a dataset as -
Session.Add("dsCustRecord", dsSearchResults);
I know that dsSearchResults is a dataset which contains 1 row.
When I later use the session variable -
DataSet dsCustRecord = new DataSet();
dsCustRecord =...
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.