473,785 Members | 2,335 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

User Control's/serverside-forms/IsPostBack/Viewstate?

Hi!

I can't show a ascx-control in a correct manner when the ascx-control uses
another ascx-control, the IsPostBack and ViewState's etc. don't seems to
work, problably because there can only be one form that runs at server per
page.

When I have this first control as an aspx-page instead, the DropDownLists in
the ascx-control I use in the aspx-page are filled with correct data and
everything works just fine, but as I tried to explain, nothing works when
converting this aspx-page that uses a ascx-control, to be an ascx-control
itself.

How do you other fellas solve the issue of multiple serverside-forms/page,
and the possibilities of using ascx-controls that's using ascx-controls
etc.?

If anybody have a solution of this problem, I would appreciate it...

Thanx for taking the time to read about this...
Nov 19 '05 #1
3 1579
dont rename an ASPX to ASCX and expect it to work as a control.
In visual studio (which I'm assuming you are using) select control as the
item you want to add, it will be properly setup then.
Controls dont get a <form> tag, they aren't meant to be used "stand-alone"
so they dont need it.

--
Curt Christianson
Site: http://www.Darkfalz.com
Blog: http://blog.Darkfalz.com
"MattGood" <jo************ @bredband.net> wrote in message
news:%2******** ********@TK2MSF TNGP12.phx.gbl. ..
Hi!

I can't show a ascx-control in a correct manner when the ascx-control uses
another ascx-control, the IsPostBack and ViewState's etc. don't seems to
work, problably because there can only be one form that runs at server per
page.

When I have this first control as an aspx-page instead, the DropDownLists
in the ascx-control I use in the aspx-page are filled with correct data
and everything works just fine, but as I tried to explain, nothing works
when converting this aspx-page that uses a ascx-control, to be an
ascx-control itself.

How do you other fellas solve the issue of multiple serverside-forms/page,
and the possibilities of using ascx-controls that's using ascx-controls
etc.?

If anybody have a solution of this problem, I would appreciate it...

Thanx for taking the time to read about this...

Nov 19 '05 #2
Thanx Curt!

But that don't seem to be the problem...
I don't just rename the ASPX, and I have "Control Language="c#"
AutoEventWireup ="false" Codebehind="" etc. in the ASCX, I set it up that way
you described, so that's not the problem, and I don't have form-tags,
starting directly with a table-tag, and I register a tagprefix and tagname
and src so I can use the other ascx-file in this one with these tags...

Actually, both the ASCX-control and the ASCX-control that is in the other is
shown, but the data is not filled, seems to be IsPostBack and ViewStates
that doesn't work...

MattGood
"Curt_C [MVP]" <software_AT_da rkfalz.com> skrev i meddelandet
news:%2******** ********@tk2msf tngp13.phx.gbl. ..
dont rename an ASPX to ASCX and expect it to work as a control.
In visual studio (which I'm assuming you are using) select control as the
item you want to add, it will be properly setup then.
Controls dont get a <form> tag, they aren't meant to be used "stand-alone"
so they dont need it.

--
Curt Christianson
Site: http://www.Darkfalz.com
Blog: http://blog.Darkfalz.com
"MattGood" <jo************ @bredband.net> wrote in message
news:%2******** ********@TK2MSF TNGP12.phx.gbl. ..
Hi!

I can't show a ascx-control in a correct manner when the ascx-control
uses another ascx-control, the IsPostBack and ViewState's etc. don't
seems to work, problably because there can only be one form that runs at
server per page.

When I have this first control as an aspx-page instead, the DropDownLists
in the ascx-control I use in the aspx-page are filled with correct data
and everything works just fine, but as I tried to explain, nothing works
when converting this aspx-page that uses a ascx-control, to be an
ascx-control itself.

How do you other fellas solve the issue of multiple
serverside-forms/page, and the possibilities of using ascx-controls
that's using ascx-controls etc.?

If anybody have a solution of this problem, I would appreciate it...

Thanx for taking the time to read about this...


Nov 19 '05 #3
But I really can't find out how to solve the problem, I was forced to have
an IFRAME in my default page, where my layout is, and put ASPX-pages in
that, to make the things work... I just want to add controls to a TD-tag or
DIV-tag or something like that, so the size of the page/control doesnt
matter in the same way it does when using a IFRAME. The IFRAME is not the
solution for me, I think... I can easily add controls to a TD-tag or
DIV-tag. But thats when the problems occurs, on postback, the whole page
reloads, and the control is vanished or has to be reloaded in page_load, and
then the states before postback is gone, of course... But, is there
something that I may have foreseen that may cause my troubles? And is there
any solution of this?

MattGood

Thanx Curt!

But that don't seem to be the problem...
I don't just rename the ASPX, and I have "Control Language="c#"
AutoEventWireup ="false" Codebehind="" etc. in the ASCX, I set it up that
way you described, so that's not the problem, and I don't have form-tags,
starting directly with a table-tag, and I register a tagprefix and tagname
and src so I can use the other ascx-file in this one with these tags...

Actually, both the ASCX-control and the ASCX-control that is in the other
is shown, but the data is not filled, seems to be IsPostBack and
ViewStates that doesn't work...

MattGood


dont rename an ASPX to ASCX and expect it to work as a control.
In visual studio (which I'm assuming you are using) select control as the
item you want to add, it will be properly setup then.
Controls dont get a <form> tag, they aren't meant to be used
"stand-alone" so they dont need it.

--
Curt Christianson
Site: http://www.Darkfalz.com
Blog: http://blog.Darkfalz.com

Hi!

I can't show a ascx-control in a correct manner when the ascx-control
uses another ascx-control, the IsPostBack and ViewState's etc. don't
seems to work, problably because there can only be one form that runs at
server per page.

When I have this first control as an aspx-page instead, the
DropDownLists in the ascx-control I use in the aspx-page are filled with
correct data and everything works just fine, but as I tried to explain,
nothing works when converting this aspx-page that uses a ascx-control,
to be an ascx-control itself.

How do you other fellas solve the issue of multiple
serverside-forms/page, and the possibilities of using ascx-controls
that's using ascx-controls etc.?

If anybody have a solution of this problem, I would appreciate it...

Thanx for taking the time to read about this...



Nov 19 '05 #4

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

Similar topics

1
5761
by: Roz Lee | last post by:
I have a page with two textboxes and two buttons which post back to the server. I want to detect which button has been clicked for testing purposes preferably clientside, but otherwise serverside. However, when I examine Page.Request.Form("__EventTarget") in my aspx.vb Page Load sub , Page.Request.Form("__EventTarget") is nothing. If I view source, the DoPostback function is not visible, nor are the hidden EventTarget and EventArgument...
3
1941
by: Dennis M | last post by:
Hey everyone, I am curious what the performance impact of a custom control would be if it had a significant hierarchy of children. For example, 40 child controls, 5 levels deep, each control on average has 20 properties. What would be the best way to implement such a thing? The book I am reading uses templated controls and basically reconstructs the entire hierarchy everytime page is accessed based on the tags in the .aspx file, but...
3
2756
by: Pradeep Kumar C | last post by:
Hi , I am working on a ASP.Net Web Application which need some requirement as given below. Let's say two user's A and B. When a User A Assign a task to B , Then B need to get some sort of alert message with out doing any action by B in his web browser, which need to tell User B that user A had assigned him some task and he need to response back to User A at the same time by and acknowledgement saying he accepted the task or...
2
1524
by: Green | last post by:
Hi, I have an user control on one page, how can i get the id of the user control? Any idea? Thanks ahead.
1
1013
by: Manny Chohan | last post by:
Hi Guys, I am newbie using C#. I have a header control with drop down application list. i need to hide panels in the navigation user control which presents users with different menus based on selection in the header list. Is there any site you can guide me so i can learn how to achieve this? Many thanks in advance. Manny
7
1482
by: Hani Atassi | last post by:
I developed a client side control using Windows Forms and I want to deploy it through IE inside an ASP.NET project. I am using the object tag to deploy: <OBJECT id="SSFileCtrl1" classid="SSCtrl.dll#SSCtrl.SSFileCtrl" VIEWASTEXT> </OBJECT> The previous code only works if SSCtrl.dll is inside the application root of ASP.NET project. It doesn't work if the file is inside the "bin" folder,
1
2961
by: news.microsoft.com | last post by:
If I have an ASP.net button inside a template for a custom control and use the code below, everything works fine and it generates the correct id and the asp.net button calls serverside click event as it should: _myTemplateContainer = New ContentContainer(Me) ContentTemplate.InstantiateIn(_myTemplateContainer) Controls.Add(_myTemplateContainer) But if I use this code, it does not generate the unique ID and no serverside event will be...
3
1524
by: DEWright_CA | last post by:
I have 2 controls on a page that need to be defined by absolute horiz. and vert. sizes, and both need to be a percentage of the screen size. Does anyone know of a easy way to grab the screen extents, divide them by fractions that can then be assigned to the controls on initialization. I am working in C# in ASP.Net! -- D @ premierdata
1
13270
by: fomalhaut | last post by:
Hi All, I'm builing an application that requires domain admin access to run, and I'm trying to allow for the application to be run as a normal user and allow the user to provide it with a username/password that has the access. I have a method that will check if the username/password is correct, however, it will only authenticate the user running the program...
7
3838
by: L. Ximenes | last post by:
Hello everyone, I know how to parse data from an XML file with Javascript; but what if I would like to parse data from a user-submitted XML file via the " <input type='file'"? Would it be possible to read directly from that file, or would I need the user to upload the file and subsequently read the data from it? In any case, what would be the best and cleaner way to do it? I thank you in advance for any insight on this,
0
9647
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
10162
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
1
10100
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
9959
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
8988
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
1
7509
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
1
4061
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
2
3665
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
3
2893
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

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.