God I hate that attribute! Good to know, but I don't think I can remove it :( so I have to rely on a recursive find control method, which may be a little less efficient but does the job.
Abbas82
Posts
-
Unable to access controls on the page -
Unable to access controls on the pageI am trying to set image visibility based on some user information. Howver I always receive the following error message Compiler Error Message: CS1061: 'XXX.SearchAcme' does not contain a definition for 'acmeBlemont' and no extension method 'acmeBlemont' accepting a first argument of type 'XXX.SearchAcme' could be found (are you missing a using directive or an assembly reference?) This is my markup and code behind so far...any ideas what the problem could be? I can't seem to figure out what the problem is. Using FindControl did not work either and while debugging the page only seems to have 1 control in the ControlCollection. However, when you hover over "this" on a breakpoint, you can drill down and see the images.
<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="Search.aspx.cs" src="Search.aspx.cs" Inherits="XXX.SearchAcme"
MasterPageFile="~/Center/Lobby.Master" %><asp:Content ID="Content1" ContentPlaceHolderID="SponsorContent" runat="server">
<img id="acmeBlemont" runat="server" src="/acme/common/custom_images/weblet4_belmont.gif" width="170" height="45" border="0" visible="false" />
<asp:Image id="acmeVerde" name="acmeVerde" runat="server" ImageUrl="/acme/common/custom_images/weblet4_verde.gif" width="170" height="45" border="0" visible="false" />
</asp:Content>namespace XXX
{
public partial class SearchAcme : AdvisorPage
{
public SearchAcme()
: base(ProgressNavIds.ChooseSearchOption)
{} protected override void OnPreRender(EventArgs e) { base.OnPreRender(e); this.acmeBlemont.Visible = true; } }
}
-
How to close DropDownExtender's Panel manually?Hi, I have a nested DIV structure (not shown here) where both have an onclick event, hence I am cancelling the event from bubbling up to the outer DIV, but this has caused the Panel to remain opened when I click on another dropdown (in another item within my repeater) or anywhere else on the page, and I am wondering if anyone knows how to close the panel manually using the AjaxControlToolkit.DropDownBehavior? Here is some source code: <%# Eval("Text") %>
The JavaScript:
function cancelEvent(e) { //var test = AjaxControlToolkit.DropDownBehavior.get_isOpen(); //src.onclick(); alert('cancel');
-
Click Event not firingI tried doing some searching through the source, but couldn't find any code I have written to do that. But then again, this is a site based on SharePoint, so there is some JavaScript I do not have access to. Although, I'd be surprised if it is a bug inherent in SharePoint.
-
Click Event not firingHello, I am working on a site with an input form that has required field validators. If the user doesn't enter something in one of the textboxes, the error message appears. When they enter something and: 1) goto another field on the form (the error message clears) then click OK, the click event fires as expected 2) click OK without focusing on another field, only the error message is cleared but the click event is never fired, hence forcing the user to click OK one more time to submit Any idea why this weird behaviour is happening? I tried it on a simple page with just a couple of textboxes and it worked fine, so I am not sure why this is acting differently? Any comments would be much appreciated.
-
COM+ Configuration SettingsHello, I have a COM+ application built using C# and the MSI for it runs just dandy, its basically a COM proxy for .NET to ASP. However, when running a test VBScript, I get the following message whenever I attempt to execute one of the methods (object seems to get created though).. on this line: set objCreditAppEntity = objComProxy.GetSavedApplication(1, "CITDE") with this message: Error retrieving certificate with ID <> from location LocalMachine and this stack trace: System.Configuration.ConfigurationException Stack Trace: at CIT.EAI.Crypto.CertificateManager.RetrieveCertificateFromStore(X509CertificateStore store, String keyIdentifier) at CIT.EAI.Crypto.CertificateManager.GetDefaultCertificate() at CIT.EAI.Web.Security.WseUtilities.GetClientToken() at CIT.EAI.Web.Security.WseUtilities.ConfigureProxy(WebServicesClientProtocol protocol) at CIT.EAI.EFCanada.ComProxy.RepositoryFactory.GetCreditAppWS() at CIT.EAI.EFCanada.ComProxy.EFCanadaComProxy.GetSavedApplication(Int32 creditAppId, String applicationCode) Any ideas why? seems to be a WSE thing, but I'm lost as I'm still kind of a newbie to COM, etc...This proxy talks to three web services by the way. VBScript test code given below ---------------------------------------------- Dim objComProxy Dim arrContact Dim errCode Dim objCreditAppEntity Dim objCreditAppEntityList Dim objQuoteEntity Dim objQuoteEntityList dim xmlDoc, sPath, sFile, sInFileName Set objComProxy = CreateObject("CIT.EAI.EFCanada.ComProxy.EFCanadaComProxy") 'ERROR HERE set objCreditAppEntity = objComProxy.GetSavedApplication(1, "CITDE") WScript.Echo "Credit app ID: " & objCreditAppEntity.CreditAppId WScript.Echo "Credit app status code: " & objCreditAppEntity.CreditAppStatusCd
-
COM+ and WSE SettingsHello, I have a COM+ application built using C# and the MSI for it runs just dandy, its basically a COM proxy for .NET to ASP. However, when running a test VBScript, I get the following message whenever I attempt to execute one of the methods (object seems to get created though).. on this line: set objCreditAppEntity = objComProxy.GetSavedApplication(1, "CITDE") with this message: Error retrieving certificate with ID <> from location LocalMachine and this stack trace: System.Configuration.ConfigurationException Stack Trace: at CIT.EAI.Crypto.CertificateManager.RetrieveCertificateFromStore(X509CertificateStore store, String keyIdentifier) at CIT.EAI.Crypto.CertificateManager.GetDefaultCertificate() at CIT.EAI.Web.Security.WseUtilities.GetClientToken() at CIT.EAI.Web.Security.WseUtilities.ConfigureProxy(WebServicesClientProtocol protocol) at CIT.EAI.EFCanada.ComProxy.RepositoryFactory.GetCreditAppWS() at CIT.EAI.EFCanada.ComProxy.EFCanadaComProxy.GetSavedApplication(Int32 creditAppId, String applicationCode) Any ideas why? seems to be a WSE thing, but I'm lost as I'm still kind of a newbie to COM, etc...This proxy talks to three web services by the way. VBScript test code given below ---------------------------------------------- Dim objComProxy Dim arrContact Dim errCode Dim objCreditAppEntity Dim objCreditAppEntityList Dim objQuoteEntity Dim objQuoteEntityList dim xmlDoc, sPath, sFile, sInFileName Set objComProxy = CreateObject("CIT.EAI.EFCanada.ComProxy.EFCanadaComProxy") 'ERROR HERE set objCreditAppEntity = objComProxy.GetSavedApplication(1, "CITDE") WScript.Echo "Credit app ID: " & objCreditAppEntity.CreditAppId WScript.Echo "Credit app status code: " & objCreditAppEntity.CreditAppStatusCd
-
Obtain Text value from Option ElementHi, I have a select list that gets populated from the DB. When the user makes a selection I am able to retrieve this value via Request.Form(...) However, I am wondering if you can retrieve the text value using ASP?? I know this can be done in JavaScript using the options text attribute, but it is possible in ASP? Any input would be appreciated....Thanks!
-
Losing a session variableYou're right, if it was a cookie issue, then there would be no session vars. at all, plus I get the HTTP cookie in my error email when an error is encountered. There is no underscore in the domain name either. Well, this is my code to send me an email regarding whats going on when an error occurs For Each item in Session.Contents CaptureSessionValues = CaptureSessionValues & "" & item & "" &_ Server.HTMLEncode(Session.Contents(item)) & "" & vbcrlf Next And the variable in question, named Home_Page (along with a few others that get set on the same page, home.asp) are not there, so I guess it never gets created? I checked my code and I dont see anything that removes it.
-
Losing a session variableCould a browser specific setting cause this? I've tried impersonating the user on the production site, and even though I am limited to what I can do (since I am not the user himself), I still havent been able to reporoduce the problem.
-
Losing a session variableHi, Currently there is a web user that always gets an error on our application due to a missing session variable. All other session variables are still in tact, but this one seems to disappear and hence the user can no longer access everything on the site. Any ideas as to where this value goes? I've checked my ASP code and saw nothing that would re-set this variable's value. Moreover, only a couple of users experience this problem Any input would be much appreciated.
-
Looping through XmlNodeListHi, I have the following code, which picks up 43 different nodes from my XML document XmlNodeList amortNodes = amortDoc.SelectNodes("// TValueAmortizationSchedule/AmortizationLine"); each node looks like this: 8 09/01/2006 100000000 0 0 0 0 100000000 100000000 13 Now I am trying to loop through the node list to get get the nodes with AmortizationLineType = 8 foreach (XmlNode amortNode in amortNodes) { amortType = amortNode.SelectSingleNode("//AmortizationLine/ AmortizationLineType").InnerText; if (amortType.Equals("8")) { count++; ........... } } Now I know from my debugging, that not all 43 nodes fulfil this criteria (ie amortType=8). However, when I run this application, the amortType always comes back as 8 (which is the value on only the first node), which seems to tell me it is not picking up the values after that? Any ideas? Thanks for your help.
-
Null reference issuejimmanuel wrote:
You must initialize data like so: data = new TVAmortizationData [10 /* 10 is arbitrary, make the array whatever size you want */];
I changed the class to the following, but I still get the same message. public class TVAmortizationSchedule { public TVAmortizationData[] data; public TVAmortizationSchedule() { data = new TVAmortizationData[5]; } }
-
Null reference issueChristian Graus wrote:
This creates an array. Every object in that array is null, until you call new on it. This is why you're getting this error.
How would I call the new on it? I instantiate the TVReturn object like so TVReturn tvret = new TVReturn(); what would be my next step?
-
Null reference issueHi, I am having a problem of storing a string into TVReturn.amortization.data[0].balanceAmount (class definitions are given below), where I get the error message saying: System.NullReferenceException: Object reference not set to an instance of an object at this line where I am testing inserting values into the amortization schedule data tvret.amortization.data[0].balanceAmount = Convert.ToDecimal("100000"); I have the following class definitions: public class TVReturn { public decimal unknownEventAmount; public double unknownNominalAnnualRate; public int unknownEventNumber; public string cashFlowDataXml; public TVAmortizationSchedule amortization; } public class TVAmortizationSchedule { public TVAmortizationData[] data; } public class TVAmortizationData { public int sequenceNumber; public string eventDate; public decimal paymentAmount; public decimal interestAmount; public decimal principalAmount; public decimal balanceAmount; }
-
Editing all GridView rowsHi, Is it possible to load up a GridView where all rows are in edit mode? Thanks
-
Editing all GridView RowsI guess so
-
Editing all GridView RowsHi, Is it possible to load up a GridView where all rows are in edit mode? Thanks
-
GridView losing its datasetYes, you are right...I managed to get it to work. Thanks!
-
GridView losing its datasetHi, I am working on a GridView control to play a game. I am trying to make the cells editable; however, when I click on edit I lost my data or I get an error: Object reference not set to an instance of an object Here is a code sample (excuse the messiness, I am still debugging things and I like to clean-up at the end)
protected void Page_Load(object sender, EventArgs e) { if (!IsPostBack) { NewGame(0); } else { lblStatus.Text = lblStatus.Text + "postback!"; //DataRow[] currentRows = mySet.Tables["numberset"].Select(null, null, DataViewRowState.CurrentRows); mySet = _newGame.GameSet; DataRow[] currentRows = mySet.Tables["problemcopyset"].Select(null, null, DataViewRowState.CurrentRows); foreach (DataRow row in currentRows) { foreach (DataColumn column in mySet.Tables["problemcopyset"].Columns) { lblStatus.Text = lblStatus.Text + row[column] ; //+ "(" + ; } ////lblStatus.Text = lblStatus.Text + row.RowState; } lblStatus.Text = lblStatus.Text + " "; } } private void NewGame(int index) { GameLevel[] levels = { GameLevel.SIMPLE, GameLevel.MEDIUM, GameLevel.COMPLEX }; if (index > -1) { _newGame.GenerateGame(levels[index]); gameGrid.Visible = false; _currentSet = _newGame.GameSet; mySet = _currentSet; _currentSet.Tables["numberset"].DefaultView.AllowNew = false; //_currentSet.Tables["numberset"].Columns["numbersets_Id"].ReadOnly = true; if (_currentSet != null) { _currentSet.Tables["answerset"].ColumnChanging += new DataColumnChangeEventHandler(this.CurrentSet_ColumnChanging); //DataRow[] currentRows = _currentSet.Tables["numberset"].Select(null, null, DataViewRowState.CurrentRows); } gameGrid.Visible = true; gameGrid.DataSource = _currentSet.Tables["numberset"]; gameGrid.DataBind(); } } protected void gameGrid_RowEditing(object sender, GridViewEditEventArgs e) { lblStatus.Text = lblStatus.Text + " editing! "; gameGrid.EditIndex = e.NewEditIndex; gameGrid.DataSource = mySet.Tables["numberset"]; gameGrid.DataBind(); }
Any help would be greatly appreciated. Thanks!