Welcome to Dream.In.Code
Getting Help is Easy!

Join 132,111 Programmers for FREE! Get instant access to thousands of experts, tutorials, code snippets, and more! There are 2,104 people online right now. Registration is fast and FREE... Join Now!




...does not exist in the current context {RESOLVED}

 
Reply to this topicStart new topic

...does not exist in the current context {RESOLVED}

PsychoCoder
post 10 Oct, 2008 - 08:06 PM
Post #1


using DIC.Core;

Group Icon
Joined: 26 Jul, 2007
Posts: 8,914



Thanked 117 times

Dream Kudos: 8475

Expert In: VB, VB.Net, C#, SQL, ASP, ASP.Net, Web Development, HTML, CSS, Win32 API, Javascript, mySQL, J#, Boo.Net

My Contributions


Has anyone ran into this before, and if so how did you resolve it. Here's the scenario, I have this code

csharp

DateTime start = Convert.ToDateTime(StartDate.Text);
DateTime end = Convert.ToDateTime(EndDate.Text);
string title = NewTitle.Text;
int active = Convert.ToInt32(rblIsActive.SelectedValue);


And I get a compilation error saying those controls don't exist crazy.gif , but here they are in the ASPX page

CODE

    <td valign="top">
        <table style="width:100%;" cellpadding="3" cellspacing="0">
            <tr>
    <td style="width: 70px;">
        New Title:</td>
    <td>
        <asp:TextBox ID="NewTitle" runat="server" CssClass="reg_form" Text='<%#Eval("Title") %>' />
    </td>
</tr>
<tr>
    <td>
        Start Date:</td>
    <td>
        <asp:TextBox ID="StartDate" runat="server" CssClass="reg_form" Text='<%#Eval("StartDate") %>' />
        <a href="java script:void(0);return false;" onclick="window.open('../../Popups/PopCalendar.aspx?type=StartDate','cal','width=250,height=225, status=0,menubar=0,location=0,toolbar=0,directories=0;')">
            <img src="../../images/main_images/SmallCalendar.gif" border="0" width="16" height="16"></a>
    </td>
</tr>
<tr>
    <td>
        End Date:</td>
    <td>
        <asp:TextBox ID="EndDate" runat="server" CssClass="reg_form" Text='<%#Eval("EndDate") %>' />
        <a href="java script:void(0);return false;" onclick="window.open('../../Popups/PopCalendar.aspx?type=EndDate','cal','width=250,height=225, status=0,menubar=0,location=0,toolbar=0,directories=0;')">
            <img src="../../images/main_images/SmallCalendar.gif" border="0" width="16" height="16"></a>
    </td>
</tr>
<tr>
    <td valign="top">
        Active:</td>
    <td>
        <asp:RadioButtonList ID="rblIsActive" runat="server">
            <asp:ListItem Value="1" Selected="true" Text="Yes" />
            <asp:ListItem Value="0" Selected="false" Text="No" />
        </asp:RadioButtonList>
    </td>
</tr>


Has anyone seen this/resolved an issue like this before in ASP.NET?
User is offlineProfile CardPM

Go to the top of the page

Jayman
post 10 Oct, 2008 - 09:45 PM
Post #2


Student of Life

Group Icon
Joined: 26 Dec, 2005
Posts: 6,837



Thanked 38 times

Dream Kudos: 500

Expert In: C#, VB.NET, Java

My Contributions


I don't see anything wrong with what you posted.

Is there anything that you didn't include that may be impacting the ability of the page to see the controls?

I typically run into this when using Ajax or having controls within another control. We use a lot of wizards which load user controls that contain all the functionality of our portal. Using the FindControl method is a necessity in these situations, as I am sure you already know. But I had to ask.

Anything like that going on with what you are doing?
User is online!Profile CardPM

Go to the top of the page

PsychoCoder
post 10 Oct, 2008 - 10:22 PM
Post #3


using DIC.Core;

Group Icon
Joined: 26 Jul, 2007
Posts: 8,914



Thanked 117 times

Dream Kudos: 8475

Expert In: VB, VB.Net, C#, SQL, ASP, ASP.Net, Web Development, HTML, CSS, Win32 API, Javascript, mySQL, J#, Boo.Net

My Contributions


Not really, I mean these controls are inside an <asp:View control, then again all other controls are as well, and none of them have I ran into this issue before. I'm almost ready to pull my damn hair out, not that I have a lot to pull anyways!

Also, no ajax at all, just simple ,Net server controls blink.gif
User is offlineProfile CardPM

Go to the top of the page

PsychoCoder
post 11 Oct, 2008 - 09:16 AM
Post #4


using DIC.Core;

Group Icon
Joined: 26 Jul, 2007
Posts: 8,914



Thanked 117 times

Dream Kudos: 8475

Expert In: VB, VB.Net, C#, SQL, ASP, ASP.Net, Web Development, HTML, CSS, Win32 API, Javascript, mySQL, J#, Boo.Net

My Contributions


Anyone have any ideas? I even went as far as to delete the page and recreate it, same thing crazy.gif
User is offlineProfile CardPM

Go to the top of the page

PsychoCoder
post 11 Oct, 2008 - 09:42 AM
Post #5


using DIC.Core;

Group Icon
Joined: 26 Jul, 2007
Posts: 8,914



Thanked 117 times

Dream Kudos: 8475

Expert In: VB, VB.Net, C#, SQL, ASP, ASP.Net, Web Development, HTML, CSS, Win32 API, Javascript, mySQL, J#, Boo.Net

My Contributions


Issue's resolved. Sometimes I wonder about myself, those controls are inside a DataList so I had to use

csharp

TextBox startDate = (TextBox)EditTag_DL.FindControl("StartDate");
TextBox endDate = (TextBox)EditTag_DL.FindControl("EndDate");
TextBox newTitle = (TextBox)EditTag_DL.FindControl("NewTitle");
CheckBox keepActive = (CheckBox)EditTag_DL.FindControl("KeepActive");


Now I just need to get rid ofthe following error that happens when I click the "Update" button

QUOTE

Invalid postback or callback argument. Event validation is enabled using <pages enableEventValidation="true"/> in configuration or <%@ Page EnableEventValidation="true" %> in a page. For security purposes, this feature verifies that arguments to postback or callback events originate from the server control that originally rendered them. If the data is valid and expected, use the ClientScriptManager.RegisterForEventValidation method in order to register the postback or callback data for validation.
User is offlineProfile CardPM

Go to the top of the page

jacobjordan
post 11 Oct, 2008 - 05:43 PM
Post #6


class Me : Perfection

Group Icon
Joined: 11 Jun, 2008
Posts: 1,103



Thanked 22 times

Dream Kudos: 1525
My Contributions


PsychoCoder, asking a q-q-question??? I didn't think it was p-p-possib-b-ble!! Help! Water! I t-t-think i'm having a st-t-troke!!
User is offlineProfile CardPM

Go to the top of the page

Fast ReplyReply to this topicStart new topic
Time is now: 11/21/08 09:57AM

Live Help!

Tutorials

Programming

Web Development

Reference Sheets

Code Snippets

Bye Bye Ads

Free DIC T-Shirt

T-Shirt Example

Related Sites

Monthly Drawing

Thumb Drive

Partners

Top Contributors

Top 10 Kudos This Month