473,320 Members | 2,048 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,320 software developers and data experts.

__aspnetForm

Hi,

I'm having problems with renaming a form when using templates.
The template type I'm using can be found here:
http://www.charon.co.uk/content.aspx...8&ArticleID=42
http://www.charon.co.uk/content.aspx...8&ArticleID=43

To summarize the articles...
I'm overriding the AddParsedSubObject() method to load a template
usercontrol, code as follows:

protected override void AddParsedSubObject(System.Object Control) {
if (pageTemplate == null)
LoadTemplate();
}

protected void LoadTemplate() {
pageTemplate =
(page_template)Page.LoadControl("/templates/page_template.ascx");
}

And in OnInit i call
base.AddParsedSubObject(pageTemplate);

This means that page_template.ascx will be displayed instead of the current
page unless I add more controls to the page (which is done but I don't see
that that is relevant in this case).
My problem is that whatever I set the ID tag in the template to (or any
other page for that matter), it always renders to __aspnetForm

Any ideas on a solusion is appriciated.

// Fredrik
Nov 18 '05 #1
4 1446
Fredrik,

I'm going to assume that you have your form tags inside of your user control
(template file). Remove those, as this will force renaming and continue to
cause you pain in various aspects of the control. Also notice that IIS on XP
Pro will rename your form differently than IIS on W2K Server or W2K3 Server.
Moving the form tag into the containing page will resolve your issue of
renaming.

Thanks,
Ian Suttle
http://www.IanSuttle.com

"Fredrik Elestedt" wrote:
Hi,

I'm having problems with renaming a form when using templates.
The template type I'm using can be found here:
http://www.charon.co.uk/content.aspx...8&ArticleID=42
http://www.charon.co.uk/content.aspx...8&ArticleID=43

To summarize the articles...
I'm overriding the AddParsedSubObject() method to load a template
usercontrol, code as follows:

protected override void AddParsedSubObject(System.Object Control) {
if (pageTemplate == null)
LoadTemplate();
}

protected void LoadTemplate() {
pageTemplate =
(page_template)Page.LoadControl("/templates/page_template.ascx");
}

And in OnInit i call
base.AddParsedSubObject(pageTemplate);

This means that page_template.ascx will be displayed instead of the current
page unless I add more controls to the page (which is done but I don't see
that that is relevant in this case).
My problem is that whatever I set the ID tag in the template to (or any
other page for that matter), it always renders to __aspnetForm

Any ideas on a solusion is appriciated.

// Fredrik

Nov 18 '05 #2
Ian,

Thanks for the reply.

I do like the idea of having the server form tag in the template file -
since I use it on all pages. But if this is the only "good" solution I will
take it. The downside is that the template will not be able to contain
controls which want to do postbacks - not that it will bother me in this
implementation, but perhaps some othertime...

Currently running on W2K3 - .NET 1.1 SP1

// Fredrik

"Ian Suttle" <Ia*******@discussions.microsoft.com> wrote in message
news:2E**********************************@microsof t.com...
Fredrik,

I'm going to assume that you have your form tags inside of your user
control
(template file). Remove those, as this will force renaming and continue
to
cause you pain in various aspects of the control. Also notice that IIS on
XP
Pro will rename your form differently than IIS on W2K Server or W2K3
Server.
Moving the form tag into the containing page will resolve your issue of
renaming.

Thanks,
Ian Suttle
http://www.IanSuttle.com

"Fredrik Elestedt" wrote:
Hi,

I'm having problems with renaming a form when using templates.
The template type I'm using can be found here:
http://www.charon.co.uk/content.aspx...8&ArticleID=42
http://www.charon.co.uk/content.aspx...8&ArticleID=43

To summarize the articles...
I'm overriding the AddParsedSubObject() method to load a template
usercontrol, code as follows:

protected override void AddParsedSubObject(System.Object Control) {
if (pageTemplate == null)
LoadTemplate();
}

protected void LoadTemplate() {
pageTemplate =
(page_template)Page.LoadControl("/templates/page_template.ascx");
}

And in OnInit i call
base.AddParsedSubObject(pageTemplate);

This means that page_template.ascx will be displayed instead of the
current
page unless I add more controls to the page (which is done but I don't
see
that that is relevant in this case).
My problem is that whatever I set the ID tag in the template to (or any
other page for that matter), it always renders to __aspnetForm

Any ideas on a solusion is appriciated.

// Fredrik

Nov 19 '05 #3
Hello,

I'm also having a similar problem because all my classes are control based.

Basically, my .aspx files are "hosts" to my main code which is in the .ascx
files/classes. I tried moving the <form...> tags to the .aspx files and put
the include between them, the project won't compile because it doesn't "see"
my server-side controls in the .ascx file as within the <form...> tags even
though technically they are.

Is there no way to get around this? It's a huge overwork for me to move the
code to the .aspx files because my classes derive from multiple levels using
the controls.

Any ideas would be greatly appreciated.

"Ian Suttle" wrote:
Fredrik,

When you take the form tags out of the user control, place them in the page
that has the user control in it:

<form runat="server">
<uc1:myControl runat="server" id="myControl1" />
</form>

You will still be able to work with postbacks using this method.

Thanks,
Ian Suttle
http://www.IanSuttle.com

"Fredrik Elestedt" wrote:
Ian,

Thanks for the reply.

I do like the idea of having the server form tag in the template file -
since I use it on all pages. But if this is the only "good" solution I will
take it. The downside is that the template will not be able to contain
controls which want to do postbacks - not that it will bother me in this
implementation, but perhaps some othertime...

Currently running on W2K3 - .NET 1.1 SP1

// Fredrik

"Ian Suttle" <Ia*******@discussions.microsoft.com> wrote in message
news:2E**********************************@microsof t.com...
Fredrik,

I'm going to assume that you have your form tags inside of your user
control
(template file). Remove those, as this will force renaming and continue
to
cause you pain in various aspects of the control. Also notice that IIS on
XP
Pro will rename your form differently than IIS on W2K Server or W2K3
Server.
Moving the form tag into the containing page will resolve your issue of
renaming.

Thanks,
Ian Suttle
http://www.IanSuttle.com

"Fredrik Elestedt" wrote:

> Hi,
>
> I'm having problems with renaming a form when using templates.
> The template type I'm using can be found here:
> http://www.charon.co.uk/content.aspx...8&ArticleID=42
> http://www.charon.co.uk/content.aspx...8&ArticleID=43
>
> To summarize the articles...
> I'm overriding the AddParsedSubObject() method to load a template
> usercontrol, code as follows:
>
> protected override void AddParsedSubObject(System.Object Control) {
> if (pageTemplate == null)
> LoadTemplate();
> }
>
> protected void LoadTemplate() {
> pageTemplate =
> (page_template)Page.LoadControl("/templates/page_template.ascx");
> }
>
> And in OnInit i call
> base.AddParsedSubObject(pageTemplate);
>
> This means that page_template.ascx will be displayed instead of the
> current
> page unless I add more controls to the page (which is done but I don't
> see
> that that is relevant in this case).
> My problem is that whatever I set the ID tag in the template to (or any
> other page for that matter), it always renders to __aspnetForm
>
> Any ideas on a solusion is appriciated.
>
> // Fredrik
>
>
>


Nov 19 '05 #4
Please disregard my last message. Putting the <form...> in the .aspx DID
work. I messed up my code in my haste. Thank you very much for pointing me
in the right direction.

"Ian Suttle" wrote:
Fredrik,

When you take the form tags out of the user control, place them in the page
that has the user control in it:

<form runat="server">
<uc1:myControl runat="server" id="myControl1" />
</form>

You will still be able to work with postbacks using this method.

Thanks,
Ian Suttle
http://www.IanSuttle.com

"Fredrik Elestedt" wrote:
Ian,

Thanks for the reply.

I do like the idea of having the server form tag in the template file -
since I use it on all pages. But if this is the only "good" solution I will
take it. The downside is that the template will not be able to contain
controls which want to do postbacks - not that it will bother me in this
implementation, but perhaps some othertime...

Currently running on W2K3 - .NET 1.1 SP1

// Fredrik

"Ian Suttle" <Ia*******@discussions.microsoft.com> wrote in message
news:2E**********************************@microsof t.com...
Fredrik,

I'm going to assume that you have your form tags inside of your user
control
(template file). Remove those, as this will force renaming and continue
to
cause you pain in various aspects of the control. Also notice that IIS on
XP
Pro will rename your form differently than IIS on W2K Server or W2K3
Server.
Moving the form tag into the containing page will resolve your issue of
renaming.

Thanks,
Ian Suttle
http://www.IanSuttle.com

"Fredrik Elestedt" wrote:

> Hi,
>
> I'm having problems with renaming a form when using templates.
> The template type I'm using can be found here:
> http://www.charon.co.uk/content.aspx...8&ArticleID=42
> http://www.charon.co.uk/content.aspx...8&ArticleID=43
>
> To summarize the articles...
> I'm overriding the AddParsedSubObject() method to load a template
> usercontrol, code as follows:
>
> protected override void AddParsedSubObject(System.Object Control) {
> if (pageTemplate == null)
> LoadTemplate();
> }
>
> protected void LoadTemplate() {
> pageTemplate =
> (page_template)Page.LoadControl("/templates/page_template.ascx");
> }
>
> And in OnInit i call
> base.AddParsedSubObject(pageTemplate);
>
> This means that page_template.ascx will be displayed instead of the
> current
> page unless I add more controls to the page (which is done but I don't
> see
> that that is relevant in this case).
> My problem is that whatever I set the ID tag in the template to (or any
> other page for that matter), it always renders to __aspnetForm
>
> Any ideas on a solusion is appriciated.
>
> // Fredrik
>
>
>


Nov 19 '05 #5

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

1
by: Jack Fox | last post by:
The following posts back properlty from an "onclick" in IE, but not in Mozilla 1.7. Can anyone explain to me why not? The style class works the same in both environments. <HEAD> <SCRIPT...
1
by: Frankieboy | last post by:
I believe I've got a postback problem on our site. The strange thing is that everything works fine on my developing version, but not on the production site. I'm wondering if there may be different...
0
by: Frankieboy | last post by:
Where is __doPostBack-function defined? I've got an application which generates a different __doPostBack-function when the code is being run on the server compared to the one on my laptop. The...
0
by: Reed | last post by:
Does asp.net rename forms in .Net v1.1? I just upgraded a server with a bunch of sites from v1.0 to 1.1, and now all the forms are named "__aspnetForm" even though I explicitly assign both the...
3
by: Fredrik Elestedt | last post by:
Hi, I have a problem with the __dopostback script when I run my webbapplication on certain servers. The code is not recompiled and the aspx filer are untouched... This is what happens, on a...
4
by: psb | last post by:
not sure if anyone still uses this, but I installed .NetFramework 1.0 sp3 (released, aug31,2004) and after that I was getting some javascript errors. I have a user control inside a webform. ...
13
by: Ian.Suttle | last post by:
I am have been researching this issue to no end, so any help would be very much appreciated. I have a page with form tags. Inside of the form tags is a panel that contains a user control. The...
1
by: Hasani \(remove nospam\) | last post by:
The way the system works is, you create a user control (ascx) that will be a template and must implement the interface IPageTemplate. You then create one or more user controls (ascx) that implement...
15
by: Fredrik Elestedt | last post by:
Hi, I've been trying to get a ASP.NET site I'm working on validated as HTML 4.01 Transitional but I've run into a couple of problems - actually the only ones left before the page is validated......
0
by: ryjfgjl | last post by:
ExcelToDatabase: batch import excel into database automatically...
0
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
1
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: jfyes | last post by:
As a hardware engineer, after seeing that CEIWEI recently released a new tool for Modbus RTU Over TCP/UDP filtering and monitoring, I actively went to its official website to take a look. It turned...
0
by: ArrayDB | last post by:
The error message I've encountered is; ERROR:root:Error generating model response: exception: access violation writing 0x0000000000005140, which seems to be indicative of an access violation...
1
by: PapaRatzi | last post by:
Hello, I am teaching myself MS Access forms design and Visual Basic. I've created a table to capture a list of Top 30 singles and forms to capture new entries. The final step is a form (unbound)...
0
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
0
by: Defcon1945 | last post by:
I'm trying to learn Python using Pycharm but import shutil doesn't work
0
by: af34tf | last post by:
Hi Guys, I have a domain whose name is BytesLimited.com, and I want to sell it. Does anyone know about platforms that allow me to list my domain in auction for free. Thank you

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.