Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > ASP .Net > Update to VS2005

Reply
Thread Tools

Update to VS2005

 
 
WO70
Guest
Posts: n/a
 
      11-03-2005
Hi NG,

I converted a VS2003 ASP.NET solution to ASP.NET 2 and got 2 Errors
like this:
ERROR: The member declaration for 'reqValEdit' was removed and its
accessibility has been changed from 'public' to 'protected'. To access
this member from another page you should create a public accessor
property for it. editor\FrageEdit.aspx.cs

I read something about the new code behind model, but I was wondering
if there is no way to change the access modifier of a WebControl.
Should I do it like (below) this now, to access a WebControl from
another Page?

- Add a TextBox with ID _TextBox1 in Designer View.
- In Codebehind add a Property like this:
public System.Web.UI.WebControls.TextBox TextBox1
{
get
{
return _TextBox1;
}
}

thx in advance
Bjoern

 
Reply With Quote
 
 
 
 
S.M. Altaf [MVP]
Guest
Posts: n/a
 
      11-03-2005
Why not just go in and physically change it back from protected to public?




--------------------------------------------------------------------------------

All that glitters has a high refractive index.
www.mendhak.com

"WO70" <(E-Mail Removed)> wrote in message news:(E-Mail Removed) oups.com...
Hi NG,

I converted a VS2003 ASP.NET solution to ASP.NET 2 and got 2 Errors
like this:
ERROR: The member declaration for 'reqValEdit' was removed and its
accessibility has been changed from 'public' to 'protected'. To access
this member from another page you should create a public accessor
property for it. editor\FrageEdit.aspx.cs

I read something about the new code behind model, but I was wondering
if there is no way to change the access modifier of a WebControl.
Should I do it like (below) this now, to access a WebControl from
another Page?

- Add a TextBox with ID _TextBox1 in Designer View.
- In Codebehind add a Property like this:
public System.Web.UI.WebControls.TextBox TextBox1
{
get
{
return _TextBox1;
}
}

thx in advance
Bjoern

 
Reply With Quote
 
 
 
 
Bruce Barker
Guest
Posts: n/a
 
      11-04-2005
it a little more complicated than that.

in 1.0/1.1 the aspx page inherited from the codebehind page. this meant if
the control was defined in the codebehind, its defination was used.

in 2.0 the code behind is a partial class (as is the aspx code). the
controls variables are now defined in the aspx page only, so you cannot
override them in the code behind.

your solution is the correct one.

-- bruce (sqlwork.com)



"WO70" <(E-Mail Removed)> wrote in message
news:(E-Mail Removed) oups.com...
> Hi NG,
>
> I converted a VS2003 ASP.NET solution to ASP.NET 2 and got 2 Errors
> like this:
> ERROR: The member declaration for 'reqValEdit' was removed and its
> accessibility has been changed from 'public' to 'protected'. To access
> this member from another page you should create a public accessor
> property for it. editor\FrageEdit.aspx.cs
>
> I read something about the new code behind model, but I was wondering
> if there is no way to change the access modifier of a WebControl.
> Should I do it like (below) this now, to access a WebControl from
> another Page?
>
> - Add a TextBox with ID _TextBox1 in Designer View.
> - In Codebehind add a Property like this:
> public System.Web.UI.WebControls.TextBox TextBox1
> {
> get
> {
> return _TextBox1;
> }
> }
>
> thx in advance
> Bjoern
>



 
Reply With Quote
 
WO70
Guest
Posts: n/a
 
      11-04-2005
Hi,

thank you. That's what I thought. But I wasn't sure

by
Bjoern

 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Update On The Windows Phone 7 Update Update Lawrence D'Oliveiro NZ Computing 2 02-25-2011 08:03 AM
Newbie problem - Changing Gridview field value (i.e. calculate a value) before clicking update VS2005 ASPX AAJ ASP .Net 0 09-06-2006 08:31 AM
vs2005 - How to update a dataset xsd after table changes dbuchanan ASP .Net 0 12-28-2005 11:45 PM
[Vb.net question] how to apply online update function into program (the effect just like Norton system work live update) chan ASP .Net 1 03-04-2004 02:58 PM
Datalist: update a datasource without using select/edit/update Hartmut Schroth ASP .Net 3 12-01-2003 09:54 AM



Advertisments