Hi!
I'm having some troubleswith a custom web control.
When I use the web control "normally", that is, I throw it into the web page at design time, its viewstate is maintained along postbacks.
However, if I add this custom control at runtime to a place holder, it loses it's viewstate when the first (and the second, and the tirdm and so on) postback is fired.
The custom control is basically a DropDownList, and as I said, the problem is that that it resets back to it's first element everytime I postback. And i see this doesn't happen with "regular" dropdownlists, I mean, the ones that already come included with the language.
ˇif anyone can help me, I'd really appreciate it!
4 919
Hi!
I'm having some troubleswith a custom web control.
When I use the web control "normally", that is, I throw it into the web page at design time, its viewstate is maintained along postbacks.
However, if I add this custom control at runtime to a place holder, it loses it's viewstate when the first (and the second, and the tirdm and so on) postback is fired.
The custom control is basically a DropDownList, and as I said, the problem is that that it resets back to it's first element everytime I postback. And i see this doesn't happen with "regular" dropdownlists, I mean, the ones that already come included with the language.
ˇif anyone can help me, I'd really appreciate it!
Can you save your state as a cookie? Or perhaps use a hidden field to save that information?
I think I may be able to implement one of those "solutions" but my question is, "shouldn't my custom control act like any other .net control???"
I was expecting to receive an answer like"you have to do this and your control will behave like any "stock" control"...
But i guess I could try your approach.
Thank you.
ps: if anyone has a better solution, one that involves my control behaving as it should, I'm still listening! =D
Ah, and I don't know either how to make a custom control whose class is not abstract, anyone knows how to do that, so I can instantiate my control at runtime, instead of leaving it laying on the page and referencing it at runtime?
I think I just solved it by using "LoadControl"! =)
Sign in to post your reply or Sign up for a free account.
Similar topics
by: George Hester |
last post by:
http://tinyurl.com/5uj6w
The lower middle icon the "block" should not drop down when the mouse is over it. How can I stop that?
Also the navigation divs both top and bottom should follow the...
|
by: Richard |
last post by:
Ok. I've quoted the inner stuff as needed.
When I click on the "form" {no errors} all I get is a momentary whiteout of
the saturn image and the saturn image returns intact.
No image swapping, no...
|
by: Jake j |
last post by:
Yes, this is a simple and straightforward thing to do as long as the .js
file doesn't use a function. When I try a script with a function in a
js file I can't get it to work (though it works fine...
|
by: Serious_Practitioner |
last post by:
Hello, all -
A few days ago, I posted the following message -
Hello all, and thank you for your help in the recent past.
Got a new error message in the last few days.
While working with...
|
by: Serious_Practitioner |
last post by:
Good day -
As you suggested, I got and used the right version of Jetcomp, and I also
tried to run compact and repair a couple of times. I think that the compact
and repair process doesn't fully...
|
by: Daniel Walzenbach |
last post by:
Hi,
I have a web application which sometimes throws an “out of memory”
exception. To get an idea what happens I traced some values using performance
monitor and got the following values (for...
|
by: yawnmoth |
last post by:
I'm having some difficulty with adding elements to a webpage via the
DOM. The following works:
main.htm:
<script>
js = document.createElement('script');
js.src='test.js';...
|
by: Donius |
last post by:
Hey everyone, i am doing some stuff where i'd like to pop up a little
confirmation before a user clicks on a 'delete' link. Just trying to
keep the markup clean, i added an attribute ...
|
by: petermichaux |
last post by:
Hi,
I have tried the following based on suggestions of the best way to
insert JavaScript into a page. This is instead of using eval().
Unfortunately IE says "unexpected call to property or...
|
by: whisher |
last post by:
Hi.
I'm not able to understand
why this simple snippet doesn't
work with IE.
It works fine with FF and Opera 9.
Code:
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"...
|
by: Charles Arthur |
last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
|
by: aa123db |
last post by:
Variable and constants
Use var or let for variables and const fror constants.
Var foo ='bar';
Let foo ='bar';const baz ='bar';
Functions
function $name$ ($parameters$) {
}
...
|
by: emmanuelkatto |
last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud.
Please let me know.
Thanks!
Emmanuel
|
by: BarryA |
last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
|
by: nemocccc |
last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
|
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,...
|
by: Hystou |
last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
|
by: Oralloy |
last post by:
Hello folks,
I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>".
The problem is that using the GNU compilers,...
|
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...
| |