ASP.Net 2.0 - App_Code Folder



hi all,

when adding a new web form in VS 2003, usually viewing the code behind for
that form will let you write any method or function and referencing any web
control placed on the form without any problems, for example writing a
function that grabs a string value from a textbox is as easy as saying:
dim str as string = me.TextBox1.Text

but with visual studio 2005 I can't do this in the simple way because the
class for
that form is placed in the app_code folder and it will not see non of the
controls on the web form, so saying:
dim str as string = me.TextBox1.Text will not work and it complains about
the TextBox1 is not defined. in more details, I have a function was working
in visual studio 2003 that calls a stored procedure in sql server 2005, this
function passes a variables (3 variables) from a 3 textboxes on the form.
And I am calling this function everytime the user changes the value of one
of these textboxes.

now since the migration, visual studio 2005 puts all classes under Ap_Code
folder (as one of their new features!!) moving my function under the
App_Code folder prevents me from calling/Getting the values of those
textboxes as they change why? because the class can't see those controls
sitting on the form!

thanks for your help.


.



Relevant Pages

  • Re: Page/Controls Inheritance in ASP.NET 2.0
    ... controls on the web form, ... function passes a variables from a 3 textboxes on the form. ... Microsoft Online Community Support ... where an initial response from the community or a Microsoft Support ...
    (microsoft.public.dotnet.framework.aspnet)
  • Re: Looping through textboxes - error in my code?
    ... I was having the same problem last time, for each control loop work in ... windows form but not web form. ... the texbox is inside a panel, a panel is inside a form ... but doesn't enable the textboxes. ...
    (microsoft.public.dotnet.framework.aspnet)
  • Please help, someone!
    ... I am using Visual Studio 2003 to develop a C# ASP.NET application. ... get the error message to recur at the moment). ... Every time I reopen my HTML page for this Web Form, ...
    (microsoft.public.vstudio.general)
  • Web Forms and Images
    ... I have an ASP based Exchange Web Form application hosted in a Public Folder. ... Inlcuded in the web page are some static images. ...
    (microsoft.public.exchange2000.development)
  • Visual Studio 2003 Gremlins
    ... I am using Visual Studio 2003 to develop a C# ASP.NET application. ... get the error message to recur at the moment). ... Every time I reopen my HTML page for this Web Form, ...
    (microsoft.public.dotnet.framework.aspnet)